|
|
@ -746,14 +746,33 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol |
|
|
|
resDTO.setEpmetUserId("f838614e67cf8ae0edaefe562b6660e5"); |
|
|
|
//生成token串
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
map.put("app", "resi"); |
|
|
|
map.put("client", "miniding"); |
|
|
|
map.put("app", AppClientConstant.APP_RESI); |
|
|
|
map.put("client", AppClientConstant.MINI_DING); |
|
|
|
map.put("userId", resDTO.getEpmetUserId()); |
|
|
|
String token = jwtTokenUtils.createToken(map); |
|
|
|
resDTO.setAuthorization(token); |
|
|
|
|
|
|
|
//4.存放Redis
|
|
|
|
this.saveTokenDtoDing(AppClientConstant.APP_RESI,AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), token, resDTO.getCustomerId()); |
|
|
|
} catch (ApiException e) { |
|
|
|
throw new EpmetException(e.getErrMsg()); |
|
|
|
} |
|
|
|
return resDTO; |
|
|
|
} |
|
|
|
|
|
|
|
private String saveTokenDtoDing(String app,String client, String userId, String token, String customerId) { |
|
|
|
int expire = jwtTokenProperties.getExpire(); |
|
|
|
TokenDto tokenDto = new TokenDto(); |
|
|
|
tokenDto.setCustomerId(customerId); |
|
|
|
tokenDto.setApp(AppClientConstant.APP_RESI); |
|
|
|
tokenDto.setClient(AppClientConstant.MINI_DING); |
|
|
|
tokenDto.setUserId(userId); |
|
|
|
tokenDto.setToken(token); |
|
|
|
tokenDto.setUpdateTime(System.currentTimeMillis()); |
|
|
|
tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); |
|
|
|
cpUserDetailRedis.set(tokenDto, expire); |
|
|
|
logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); |
|
|
|
return token; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|