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

优化演示用户的删除逻辑

parent bcd07444
...@@ -72,10 +72,10 @@ public class ExceptionConstants { ...@@ -72,10 +72,10 @@ public class ExceptionConstants {
public static final String USER_NAME_LIMIT_USE_MSG = "此用户名限制使用"; public static final String USER_NAME_LIMIT_USE_MSG = "此用户名限制使用";
//演示用户不允许删除 //演示用户不允许删除
public static final int USER_LIMIT_DELETE_CODE = 500006; public static final int USER_LIMIT_DELETE_CODE = 500006;
public static final String USER_LIMIT_DELETE_MSG = "抱歉,演示用户不允许删除"; public static final String USER_LIMIT_DELETE_MSG = "抱歉,演示模式下的演示用户不允许删除";
//演示用户不允许修改 //演示用户不允许修改
public static final int USER_LIMIT_UPDATE_CODE = 500007; public static final int USER_LIMIT_UPDATE_CODE = 500007;
public static final String USER_LIMIT_UPDATE_MSG = "抱歉,演示用户不允许修改"; public static final String USER_LIMIT_UPDATE_MSG = "抱歉,演示模式下的演示用户不允许修改";
/** /**
* 角色信息 * 角色信息
......
...@@ -257,7 +257,7 @@ public class UserService { ...@@ -257,7 +257,7 @@ public class UserService {
sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE);
List<User> list = getUserListByIds(ids); List<User> list = getUserListByIds(ids);
for(User user: list){ for(User user: list){
if(user.getLoginName().equals(TEST_USER)){ if(demonstrateOpen && user.getLoginName().equals(TEST_USER)){
logger.error("异常码[{}],异常提示[{}],参数,ids:[{}]", logger.error("异常码[{}],异常提示[{}],参数,ids:[{}]",
ExceptionConstants.USER_LIMIT_DELETE_CODE,ExceptionConstants.USER_LIMIT_DELETE_MSG,ids); ExceptionConstants.USER_LIMIT_DELETE_CODE,ExceptionConstants.USER_LIMIT_DELETE_MSG,ids);
throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_DELETE_CODE, throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_DELETE_CODE,
...@@ -539,7 +539,7 @@ public class UserService { ...@@ -539,7 +539,7 @@ public class UserService {
throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE, throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE,
ExceptionConstants.USER_NAME_LIMIT_USE_MSG); ExceptionConstants.USER_NAME_LIMIT_USE_MSG);
} else { } else {
if(ue.getLoginName().equals(TEST_USER)){ if(demonstrateOpen && ue.getLoginName().equals(TEST_USER)){
logger.error("异常码[{}],异常提示[{}],参数,obj:[{}]", logger.error("异常码[{}],异常提示[{}],参数,obj:[{}]",
ExceptionConstants.USER_LIMIT_UPDATE_CODE,ExceptionConstants.USER_LIMIT_UPDATE_MSG, TEST_USER); ExceptionConstants.USER_LIMIT_UPDATE_CODE,ExceptionConstants.USER_LIMIT_UPDATE_MSG, TEST_USER);
throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_UPDATE_CODE, throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_UPDATE_CODE,
......
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