优化登录
This commit is contained in:
@@ -107,33 +107,30 @@ public class UserController {
|
|||||||
case ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION:
|
case ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION:
|
||||||
msgTip = "access service error";
|
msgTip = "access service error";
|
||||||
break;
|
break;
|
||||||
default:
|
case ExceptionCodeConstants.UserExceptionCode.USER_CONDITION_FIT:
|
||||||
try {
|
msgTip = "user can login";
|
||||||
msgTip = "user can login";
|
//验证通过 ,可以登录,放入session,记录登录日志
|
||||||
//验证通过 ,可以登录,放入session,记录登录日志
|
user = userService.getUserByLoginName(loginName);
|
||||||
user = userService.getUserByLoginName(loginName);
|
if(user.getTenantId()!=null) {
|
||||||
if(user.getTenantId()!=null) {
|
token = token + "_" + user.getTenantId();
|
||||||
token = token + "_" + user.getTenantId();
|
}
|
||||||
}
|
redisService.storageObjectBySession(token,"userId",user.getId());
|
||||||
redisService.storageObjectBySession(token,"userId",user.getId());
|
if(user.getTenantId()!=null) {
|
||||||
if(user.getTenantId()!=null) {
|
Tenant tenant = tenantService.getTenantByTenantId(user.getTenantId());
|
||||||
Tenant tenant = tenantService.getTenantByTenantId(user.getTenantId());
|
if(tenant!=null) {
|
||||||
if(tenant!=null) {
|
Long tenantId = tenant.getTenantId();
|
||||||
Long tenantId = tenant.getTenantId();
|
Integer userNumLimit = tenant.getUserNumLimit();
|
||||||
Integer userNumLimit = tenant.getUserNumLimit();
|
Integer billsNumLimit = tenant.getBillsNumLimit();
|
||||||
Integer billsNumLimit = tenant.getBillsNumLimit();
|
if(tenantId!=null) {
|
||||||
if(tenantId!=null) {
|
redisService.storageObjectBySession(token,"tenantId",tenantId); //租户tenantId
|
||||||
redisService.storageObjectBySession(token,"tenantId",tenantId); //租户tenantId
|
redisService.storageObjectBySession(token,"userNumLimit",userNumLimit); //用户限制数
|
||||||
redisService.storageObjectBySession(token,"userNumLimit",userNumLimit); //用户限制数
|
redisService.storageObjectBySession(token,"billsNumLimit",billsNumLimit); //单据限制数
|
||||||
redisService.storageObjectBySession(token,"billsNumLimit",billsNumLimit); //单据限制数
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(">>>>>>>>>>>>>>>查询用户名为:" + loginName + " ,用户信息异常", e);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
Map<String, Object> data = new HashMap<String, Object>();
|
Map<String, Object> data = new HashMap<String, Object>();
|
||||||
data.put("msgTip", msgTip);
|
data.put("msgTip", msgTip);
|
||||||
|
|||||||
Reference in New Issue
Block a user