Commit 270462d7 by songweifeng

ceshi

parent 08b12045
......@@ -100,13 +100,73 @@ public class LoginController
}
}
if (!account.getIsSuperUser()) {
String nowDate = DateUtil.format(new Date(), DateUtil.C_DATE_PATTON_DEFAULT);
if (account.getIsSuperUser()) {
//母账号
if (account.getStatus() == 0) {
//主账号禁用
rtnMap.put("msg", "主账号禁用");
rtnMap.put("code", 208);
return ResultModel.OK(rtnMap);
} else if (account.getStatus() == -1) {
//主账号还没通过审核
rtnMap.put("msg", "还没通过审核");
rtnMap.put("code", 210);
return ResultModel.OK(rtnMap);
} else if (account.getStatus() == -2) {
//主账号还没通过审核
rtnMap.put("msg", "还没通过审核");
rtnMap.put("code", 210);
return ResultModel.OK(rtnMap);
}
//主账号过期
if (!StringUtil.isEmpty(account.getPastDate()) && DateUtil.compare_date(nowDate, account.getPastDate()) == 1) {
rtnMap.put("msg", "主账号过期");
rtnMap.put("code", 206);
return ResultModel.OK(rtnMap);
}
}else {
//子账号
if (account.getStatus() == 0) {
// 子账号禁用
rtnMap.put("msg", "子账号禁用");
rtnMap.put("code", 203);
return ResultModel.OK(rtnMap);
} else if(!account.getRoleCategory().equals(5L)){
//获取根节点母账号
Account parent = authService.findRootParentAccount(account.getId());
if (parent.getStatus() == 0) {
//子账号所在主账号被禁用
rtnMap.put("msg", "子账号所在主账号被禁用");
rtnMap.put("code", 209);
return ResultModel.OK(rtnMap);
} else if (!StringUtil.isEmpty(parent.getPastDate()) && DateUtil.compare_date(nowDate, parent.getPastDate()) == 1) {
//子账号所在主账号过期
rtnMap.put("msg", "子账号所在主账号过期");
rtnMap.put("code", 207);
return ResultModel.OK(rtnMap);
}
}
//没有控制权限AuthStr没有授权
if (!account.getRoleCategory().equals(RoleEnumType.MANAGER.getKey())) {
if (!ValidateUtil.isValid(account.getAuthStr()) || !ValidateUtil.isValid(JSONObject.fromObject(account.getAuthStr()))) {
rtnMap.put("msg", "没有产品权限");
rtnMap.put("code", 202);
return ResultModel.OK(rtnMap);
}
}
}
......@@ -144,7 +204,6 @@ public class LoginController
catch (Exception e) {
logger.error("fail to parse ip," + e.getMessage());
}
return ResultModel.OK(rtnMap);
}
else {
......
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