Commit ec6bb1e7 by 刘红梅

UserUtils.setUserId(zhuanJiaUser);

parent a96d2dba
...@@ -7,6 +7,7 @@ import com.cnooc.expert.common.exception.BusinessException; ...@@ -7,6 +7,7 @@ import com.cnooc.expert.common.exception.BusinessException;
import com.cnooc.expert.common.exception.GlobalErrorCodeConstants; import com.cnooc.expert.common.exception.GlobalErrorCodeConstants;
import com.cnooc.expert.common.utils.JwtUtils; import com.cnooc.expert.common.utils.JwtUtils;
import com.cnooc.expert.common.utils.Sm2Util; import com.cnooc.expert.common.utils.Sm2Util;
import com.cnooc.expert.common.utils.UserUtils;
import com.cnooc.expert.common.utils.ValidUtils; import com.cnooc.expert.common.utils.ValidUtils;
import com.cnooc.expert.external.expert.auth.service.LoginServicesClient; import com.cnooc.expert.external.expert.auth.service.LoginServicesClient;
import com.cnooc.expert.external.expert.model.response.ExpertInfoAppResp; import com.cnooc.expert.external.expert.model.response.ExpertInfoAppResp;
...@@ -193,7 +194,7 @@ public class LoginServiceImpl implements LoginService { ...@@ -193,7 +194,7 @@ public class LoginServiceImpl implements LoginService {
ZhuanJiaUser zhuanJiaUser = convert2ZhuanjiaUser( expertInfoResp ); ZhuanJiaUser zhuanJiaUser = convert2ZhuanjiaUser( expertInfoResp );
redisTemplate.opsForValue().set(TokenConstants.LOGIN_USER_KEY_ + expertInfoResp.getZhuanJiaGuid(), zhuanJiaUser, 48, TimeUnit.HOURS); redisTemplate.opsForValue().set(TokenConstants.LOGIN_USER_KEY_ + expertInfoResp.getZhuanJiaGuid(), zhuanJiaUser, 48, TimeUnit.HOURS);
UserUtils.setUserId(zhuanJiaUser);
String token = JwtUtils.createToken(expertInfoResp.getZhuanJiaGuid(),uuidKey); String token = JwtUtils.createToken(expertInfoResp.getZhuanJiaGuid(),uuidKey);
//6.返回token //6.返回token
return token; return token;
...@@ -222,10 +223,11 @@ public class LoginServiceImpl implements LoginService { ...@@ -222,10 +223,11 @@ public class LoginServiceImpl implements LoginService {
} }
//3.生成相应的uuid作为redis的key //3.生成相应的uuid作为redis的key
String uuidKey = UUID.randomUUID().toString(); String uuidKey = UUID.randomUUID().toString();
//expertInfoResp = new ExpertInfoResp();
//expertInfoResp.setZhuanJiaGuid("1234");
ZhuanJiaUser zhuanJiaUser = convert2ZhuanjiaUser( expertInfoResp ); ZhuanJiaUser zhuanJiaUser = convert2ZhuanjiaUser( expertInfoResp );
redisTemplate.opsForValue().set(TokenConstants.LOGIN_USER_KEY_ + expertInfoResp.getZhuanJiaGuid(), zhuanJiaUser, 48, TimeUnit.HOURS); redisTemplate.opsForValue().set(TokenConstants.LOGIN_USER_KEY_ + expertInfoResp.getZhuanJiaGuid(), zhuanJiaUser, 48, TimeUnit.HOURS);
UserUtils.setUserId(zhuanJiaUser);
String token = JwtUtils.createToken(expertInfoResp.getZhuanJiaGuid(),uuidKey); String token = JwtUtils.createToken(expertInfoResp.getZhuanJiaGuid(),uuidKey);
return token; return token;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment