|
|
@ -70,6 +70,7 @@ public class AuthFilter implements GlobalFilter, Ordered
|
|
|
|
String userid = JwtUtils.getUserId(claims);
|
|
|
|
String userid = JwtUtils.getUserId(claims);
|
|
|
|
String username = JwtUtils.getUserName(claims);
|
|
|
|
String username = JwtUtils.getUserName(claims);
|
|
|
|
String stationId = JwtUtils.getStationId(claims);
|
|
|
|
String stationId = JwtUtils.getStationId(claims);
|
|
|
|
|
|
|
|
String stationCode = JwtUtils.getStationCode(claims);
|
|
|
|
if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username))
|
|
|
|
if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return unauthorizedResponse(exchange, "令牌验证失败");
|
|
|
|
return unauthorizedResponse(exchange, "令牌验证失败");
|
|
|
@ -80,6 +81,7 @@ public class AuthFilter implements GlobalFilter, Ordered
|
|
|
|
addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid);
|
|
|
|
addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid);
|
|
|
|
addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username);
|
|
|
|
addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username);
|
|
|
|
addHeader(mutate, SecurityConstants.DETAILS_STATION_ID, stationId);
|
|
|
|
addHeader(mutate, SecurityConstants.DETAILS_STATION_ID, stationId);
|
|
|
|
|
|
|
|
addHeader(mutate, SecurityConstants.DETAILS_STATION_CODE, stationCode);
|
|
|
|
// 内部请求来源参数清除
|
|
|
|
// 内部请求来源参数清除
|
|
|
|
removeHeader(mutate, SecurityConstants.FROM_SOURCE);
|
|
|
|
removeHeader(mutate, SecurityConstants.FROM_SOURCE);
|
|
|
|
return chain.filter(exchange.mutate().request(mutate.build()).build());
|
|
|
|
return chain.filter(exchange.mutate().request(mutate.build()).build());
|
|
|
|