Pārlūkot izejas kodu

修改接口权限system:permission:assign-user-role-sh

gaohp 1 gadu atpakaļ
vecāks
revīzija
8a3a34426c

+ 1 - 0
feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/service/delivery/DeliveryExpressTemplateServiceImpl.java

@@ -247,6 +247,7 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
     private ShopBO getShop() {
         Long loginUserId = getLoginUserId();
         String s = stringRedisTemplate.opsForValue().get("shop:" + loginUserId);
+        log.info("");
         if (StringUtils.isEmpty(s)) {
             AdminUserDO adminUserDO = userMapper.selectById(loginUserId);
             ShopBO shop = new ShopBO();

+ 1 - 0
feifan-module-system/feifan-module-system-biz/src/main/java/cn/newfeifan/mall/module/system/controller/admin/auth/AuthController.java

@@ -114,6 +114,7 @@ public class AuthController {
         Set<Long> menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId));
         List<MenuDO> menuList = menuService.getMenuList(menuIds);
         menuList.removeIf(menu -> !CommonStatusEnum.ENABLE.getStatus().equals(menu.getStatus())); // 移除禁用的菜单
+        menuList.removeIf(menu -> !menu.getCategoryId().equals(1L)); // 移除平台菜单
 
         // 2. 拼接结果返回
         return success(AuthConvert.INSTANCE.convert(user, roles, menuList));

+ 2 - 2
feifan-module-system/feifan-module-system-biz/src/main/java/cn/newfeifan/mall/module/system/controller/admin/permission/PermissionController.java

@@ -66,14 +66,14 @@ public class PermissionController {
     @Operation(summary = "获得管理员拥有的角色编号列表")
     @Parameter(name = "userId", description = "用户编号", required = true)
     @GetMapping("/list-user-roles")
-    @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
+    @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role-sh')")
     public CommonResult<Set<Long>> listAdminRoles(@RequestParam("userId") Long userId) {
         return success(permissionService.getUserRoleIdListByUserId(userId));
     }
 
     @Operation(summary = "赋予用户角色")
     @PostMapping("/assign-user-role")
-    @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
+    @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role-sh')")
     public CommonResult<Boolean> assignUserRole(@Validated @RequestBody PermissionAssignUserRoleReqVO reqVO) {
         permissionService.assignUserRole(reqVO.getUserId(), reqVO.getRoleIds());
         return success(true);