Commit dff734d7 authored by 季圣华's avatar 季圣华
Browse files

解决租户会被误删的bug

parent f46166a5
......@@ -76,6 +76,9 @@ public class ExceptionConstants {
//演示用户不允许修改
public static final int USER_LIMIT_UPDATE_CODE = 500007;
public static final String USER_LIMIT_UPDATE_MSG = "抱歉,演示模式下的演示用户不允许修改";
//租户不能被删除
public static final int USER_LIMIT_TENANT_DELETE_CODE = 500008;
public static final String USER_LIMIT_TENANT_DELETE_MSG = "抱歉,租户不能被删除";
/**
* 角色信息
......
......@@ -263,6 +263,12 @@ public class UserService {
throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_DELETE_CODE,
ExceptionConstants.USER_LIMIT_DELETE_MSG);
}
if(user.getId().equals(user.getTenantId())) {
logger.error("异常码[{}],异常提示[{}],参数,ids:[{}]",
ExceptionConstants.USER_LIMIT_TENANT_DELETE_CODE,ExceptionConstants.USER_LIMIT_TENANT_DELETE_MSG,ids);
throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_TENANT_DELETE_CODE,
ExceptionConstants.USER_LIMIT_TENANT_DELETE_MSG);
}
sb.append("[").append(user.getLoginName()).append("]");
}
logService.insertLog("用户", sb.toString(),
......
Supports Markdown
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