xieb
2025-01-21 bd8d88e5e984e59a5c895ec1a254e3dbae1f9f21
src/main/java/org/springblade/modules/system/controller/RoleController.java
@@ -33,7 +33,6 @@
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.entity.Role;
import org.springblade.modules.system.entity.User;
@@ -60,7 +59,7 @@
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/role")
@Api(value = "角色", tags = "角色")
@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
//@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
public class RoleController extends BladeController {
   private final IRoleService roleService;
@@ -88,6 +87,7 @@
   @ApiOperation(value = "列表", notes = "传入role")
   public R<List<RoleVO>> list(@ApiIgnore @RequestParam Map<String, Object> role, BladeUser bladeUser) {
      QueryWrapper<Role> queryWrapper = Condition.getQueryWrapper(role, Role.class);
      queryWrapper.orderByAsc("sort");
      List<Role> list = roleService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Role::getTenantId, bladeUser.getTenantId()) : queryWrapper);
      return R.data(RoleWrapper.build().listNodeVO(list));
   }