mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
fix: use new jwt header name to fix nginx remove header bug #910
This commit is contained in:
parent
3edaae67dd
commit
c04cb08390
@ -39,7 +39,8 @@ public class AuthConstants {
|
|||||||
* JWT key
|
* JWT key
|
||||||
* 前端 header 默认首字母大写,保持一致方便处理
|
* 前端 header 默认首字母大写,保持一致方便处理
|
||||||
*/
|
*/
|
||||||
public static final String JWT_NAME = "Power_jwt";
|
public static final String OLD_JWT_NAME = "Power_jwt";
|
||||||
|
public static final String JWT_NAME = "PowerJwt";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 前端跳转到指定页面指令
|
* 前端跳转到指定页面指令
|
||||||
|
@ -216,6 +216,9 @@ public class PowerJobLoginServiceImpl implements PowerJobLoginService {
|
|||||||
private Optional<JwtBody> parseJwt(HttpServletRequest httpServletRequest) {
|
private Optional<JwtBody> parseJwt(HttpServletRequest httpServletRequest) {
|
||||||
// header、cookie 都能获取
|
// header、cookie 都能获取
|
||||||
String jwtStr = HttpServletUtils.fetchFromHeader(AuthConstants.JWT_NAME, httpServletRequest);
|
String jwtStr = HttpServletUtils.fetchFromHeader(AuthConstants.JWT_NAME, httpServletRequest);
|
||||||
|
if (StringUtils.isEmpty(jwtStr)) {
|
||||||
|
jwtStr = HttpServletUtils.fetchFromHeader(AuthConstants.OLD_JWT_NAME, httpServletRequest);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user