提交 6d7ebeb7 编写于 作者: Chongwen.jiang's avatar Chongwen.jiang

token续时提供client1.0.3.1。

上级 34018470
流水线 #22526 已失败 于阶段
in 0 second
......@@ -55,10 +55,10 @@ public class TokenUtils {
// 非游客token才去执行token续时代码
Map<String, String> map = cacheClient.getToken(token);
if(!CollectionUtils.isEmpty(map)) {
if (!CollectionUtils.isEmpty(map)) {
String id = map.get("id");
logger.info("tokenContinueTime-start-userId-{}", id);
if(StringUtils.isNotEmpty(id) && Integer.parseInt(id) > 0) {
if (StringUtils.isNotEmpty(id) && Integer.parseInt(id) > 0) {
// 根据不同的产品线设置token有效期(web/admin token有效期30天,ios/android/h5 token有效期24小时)
int expiredSeconds = 24 * 60 * 60;
if (!SourceTypeEnum.SAAS.getCode().equals(sourceType) &&
......@@ -70,9 +70,14 @@ public class TokenUtils {
String key = "token-" + token;
// value = "token-doctor-{doctorId}";
String value = cacheClient.get(key);
try {
cacheClient.set(key, value, expiredSeconds);
cacheClient.set(value + "-" + sourceTypeRedis, key, expiredSeconds);
return true;
} catch (Exception e) {
logger.error("tokenContinueTime-Exception-{}" + e.getMessage(), e);
return false;
}
}
}
return false;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册