解决租户会被误删的bug

This commit is contained in:
季圣华
2021-08-28 22:10:28 +08:00
parent f46166a56b
commit dff734d736
2 changed files with 9 additions and 0 deletions

View File

@@ -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 = "抱歉,租户不能被删除";
/**
* 角色信息

View File

@@ -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(),