|
|
@ -74,23 +74,27 @@ public class InternalAuthProcessor extends AuthProcessor { |
|
|
|
app = (String) claims.get(AppClientConstant.APP); |
|
|
|
client = (String) claims.get(AppClientConstant.CLIENT); |
|
|
|
userId = (String) claims.get(AppClientConstant.USER_ID); |
|
|
|
customerId = (String) claims.get(AppClientConstant.CUSTOMER_ID); |
|
|
|
expiration = claims.getExpiration(); |
|
|
|
baseTokenDto = cpUserDetailRedis.get(app, client, userId, BaseTokenDto.class); |
|
|
|
//市北数字社区 如果redis里不存在 则自动登陆 生成token放入redis
|
|
|
|
if (baseTokenDto == null){ |
|
|
|
Result<String> stringResult = epmetAuthOpenFeignClient.generateTokenBySSOKey("123", userId, CustomerIdConstant.SHI_BEI_CUSTOMER_ID); |
|
|
|
if (stringResult != null && stringResult.success() && StringUtils.isNotBlank(stringResult.getData())){ |
|
|
|
baseTokenDto = new BaseTokenDto(); |
|
|
|
baseTokenDto.setApp(app); |
|
|
|
baseTokenDto.setClient(client); |
|
|
|
baseTokenDto.setUserId(userId); |
|
|
|
String tokenNew = stringResult.getData(); |
|
|
|
//把传过来的token用新的token 替换
|
|
|
|
token = tokenNew; |
|
|
|
baseTokenDto.setToken(tokenNew); |
|
|
|
baseTokenDto.setCustomerId(CustomerIdConstant.SHI_BEI_CUSTOMER_ID); |
|
|
|
//目前只支持市北客户ID 这样免登陆
|
|
|
|
if (CustomerIdConstant.SHI_BEI_CUSTOMER_ID.equals(customerId)){ |
|
|
|
Result<String> stringResult = epmetAuthOpenFeignClient.generateTokenBySSOKey("123", userId, customerId); |
|
|
|
if (stringResult != null && stringResult.success() && StringUtils.isNotBlank(stringResult.getData())){ |
|
|
|
baseTokenDto = new BaseTokenDto(); |
|
|
|
baseTokenDto.setApp(app); |
|
|
|
baseTokenDto.setClient(client); |
|
|
|
baseTokenDto.setUserId(userId); |
|
|
|
String tokenNew = stringResult.getData(); |
|
|
|
//把传过来的token用新的token 替换
|
|
|
|
token = tokenNew; |
|
|
|
baseTokenDto.setToken(tokenNew); |
|
|
|
baseTokenDto.setCustomerId(CustomerIdConstant.SHI_BEI_CUSTOMER_ID); |
|
|
|
} |
|
|
|
logger.info("stringResult"+ JSON.toJSONString(stringResult)); |
|
|
|
} |
|
|
|
logger.info("stringResult"+ JSON.toJSONString(stringResult)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|