Browse Source

role add roleKey defalt

hexiao 2 years atrás
parent
commit
c39ef81e69

+ 6 - 3
purchase-admin/src/main/java/com/ozs/web/controller/system/SysRoleController.java

@@ -155,10 +155,13 @@ public class SysRoleController extends BaseController
         {
             return error("新增角色'" + sysRole.getRoleName() + "'失败,角色名称已存在");
         }
+        if(org.apache.commons.lang3.StringUtils.isBlank(sysRole.getRoleKey())){
+            sysRole.setRoleKey("common");
+        }
         sysRole.setCreateBy(getUsername());
         return toAjax(roleService.addRole(sysRole));
     }
-    
+
     @PreAuthorize("@ss.hasPermi('system:role:addDistribution')")
     @PostMapping("/saveDistributionModule")
     @ApiOperation("新增分配模块")
@@ -223,7 +226,7 @@ public class SysRoleController extends BaseController
         role.setUpdateBy(getUsername());
 
         return toAjax(roleService.updateRoles(role));
-        
+
     }
 
     /**
@@ -239,7 +242,7 @@ public class SysRoleController extends BaseController
         roleService.checkRoleDataScope(role.getRoleId());
         return toAjax(roleService.authDataScope(role));
     }
-    
+
     @PreAuthorize("@ss.hasPermi('system:role:editDistribution')")
     @PostMapping("/updateDistributionModule")
     @ApiOperation("修改分配模块")