Browse Source

fix cache bug

release_toaliyun_real
xiaohanzi 5 years ago
parent
commit
5dd5de3baa
2 changed files with 6 additions and 0 deletions
  1. +1
    -0
      mallinkService/src/main/java/com/iformall/service/cuser/wx/WxCUserServiceAdapter.java
  2. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/CUserTokenServiceImpl.java

+ 1
- 0
mallinkService/src/main/java/com/iformall/service/cuser/wx/WxCUserServiceAdapter.java View File

@@ -22,6 +22,7 @@ public class WxCUserServiceAdapter implements CUserServiceApapter{
entity.setExpireTime(wxCUser.getExpireTime());
entity.setUserId(wxCUser.getUserId());
entity.setToken(wxCUser.getToken());
entity.updateTenantInfo(wxCUser);
entity.setRealUser(wxCUser);
return entity;
}


+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/CUserTokenServiceImpl.java View File

@@ -9,6 +9,8 @@ import com.iformall.service.CUserTokenService;
import com.iformall.service.cuser.CUserServiceFactory;
import com.iformall.utils.Constant;
import com.iformall.utils.RedisCacheUtils;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -54,6 +56,9 @@ public class CUserTokenServiceImpl implements CUserTokenService {
if(null == baseUser) {
baseUser = cuserFactory.getCUserService(getPlat(token)).getByToken(token);
if (StringUtils.isBlank(baseUser.getTenantId())) {
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"baseUser has no tenantinfo.");
}
setCache(token,baseUser);
}
return baseUser;


Loading…
Cancel
Save