Commit fc1373dc authored by gaoguangjing's avatar gaoguangjing

租户ID类型比较

parent 322c5b2d
......@@ -317,7 +317,7 @@ public class AppController implements IBaseController {
return JsonResult.buildErrorStateResult("登录失败", null);
}
//校验租户ID tenantId
if (TenantUtil.TENANT_DEFAULT != null && TenantUtil.TENANT_DEFAULT !=0 && TenantUtil.TENANT_DEFAULT != tenantId) {
if (TenantUtil.TENANT_DEFAULT != null && TenantUtil.TENANT_DEFAULT !=0 && !TenantUtil.TENANT_DEFAULT.equals(tenantId)) {
oauthLoginInfoService.addLoginInfo(user, tenantId);
}
LoginProperties loginProperties = new LoginProperties("", 4, channelId, registerFrom, appChannel, null, "", tenantId);
......
......@@ -103,7 +103,7 @@ public class AppletServiceImpl implements IAppletService {
throw new AppletException("未找到此用户","0401");
}
//校验租户ID tenantId
if (TenantUtil.TENANT_DEFAULT != null && TenantUtil.TENANT_DEFAULT !=0 && TenantUtil.TENANT_DEFAULT != tenantId) {
if (TenantUtil.TENANT_DEFAULT != null && TenantUtil.TENANT_DEFAULT !=0 && !TenantUtil.TENANT_DEFAULT.equals(tenantId)) {
iOauthLoginInfoService.addLoginInfo(user, tenantId);
}
LoginVo loginVo = loginModule.loginByUserId(user.getRegisteredFrom(),
......
......@@ -19,6 +19,7 @@ import org.springframework.cache.annotation.Caching;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.sql.Timestamp;
......@@ -104,7 +105,7 @@ public class SessionServiceImpl implements ISessionService {
* @return redisKey. 用来标识这个渠道的用户 Session 是否存在
*/
private String generateLoginPropertiesKey(Long userId, LoginProperties properties) {
if (properties.getTenantId() == null || properties.getTenantId() == 0 || TenantUtil.TENANT_DEFAULT == properties.getTenantId()) {
if (ObjectUtils.isEmpty(properties.getTenantId()) || properties.getTenantId() == 0 || TenantUtil.TENANT_DEFAULT.equals(properties.getTenantId())) {
return Constants.Session.USER_SESSION_ID_CACHE + ":" + userId + ":" + properties.getMerchantName() + ":" + properties.getCreatedFrom();
}else {
return Constants.Session.USER_SESSION_ID_CACHE + ":" + userId + ":" + properties.getMerchantName() + ":" + properties.getCreatedFrom() + ":" + properties.getTenantId();
......
......@@ -390,7 +390,7 @@ public class UserServiceImpl implements IUserService, IBaseController {
log.info("神策埋点出现问题", e);
}
//校验租户ID tenantId
if (TenantUtil.TENANT_DEFAULT != null && TenantUtil.TENANT_DEFAULT !=0 && TenantUtil.TENANT_DEFAULT != tenantId) {
if (TenantUtil.TENANT_DEFAULT != null && TenantUtil.TENANT_DEFAULT !=0 && !TenantUtil.TENANT_DEFAULT.equals(tenantId)) {
oauthLoginInfoService.addLoginInfo(user, tenantId);
}
LoginProperties loginProperties = new LoginProperties("", 3, channelId, createdFrom, appChannel, merchant.getId(), merchant.getName(), null);
......
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