xuhy
6 天以前 11ecb9ee39fc61af04cd8d462faf9dce496d1773
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
@@ -62,16 +62,22 @@
    @Autowired
    private ISysMenuService menuService;
    @PreAuthorize("@ss.hasPermi('system:role')")
//    @PreAuthorize("@ss.hasPermi('system:role')")
    @ApiOperation(value = "角色列表")
    @PostMapping("/list")
    public AjaxResult list(@RequestBody SysRoleQuery query)
    {
        Integer roleType = tokenService.getLoginUser().getUser().getRoleType();
        if(roleType == 1 || roleType == 4 || roleType == 5){
            query.setRoleType(roleType);
        }
        PageInfo<SysRole> list = roleService.selectPageList(query);
        return AjaxResult.success(list);
    }
    @PreAuthorize("@ss.hasPermi('system:role')")
//    @PreAuthorize("@ss.hasPermi('system:role')")
    @ApiOperation(value = "角色列表不分页")
    @PostMapping("/listNotPage")
    public AjaxResult list()
@@ -94,16 +100,6 @@
        map.put("stop",stop);
        return AjaxResult.success(map);
    }
//    @Log(title = "角色管理", businessType = BusinessType.EXPORT)
//    // @PreAuthorize("@ss.hasPermi('system:role:export')")
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, SysRole role)
//    {
//        List<SysRole> list = roleService.selectRoleList(role);
//        ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
//        util.exportExcel(response, list, "角色数据");
//    }
    /**
     * 根据角色编号获取详细信息
@@ -152,7 +148,7 @@
    /**
     * 新增角色
     */
     @PreAuthorize("@ss.hasPermi('system:role:add')")
//     @PreAuthorize("@ss.hasPermi('system:role:add')")
    @ApiOperation(value = "新增角色")
    @Log(title = "角色信息-新增角色", businessType = BusinessType.INSERT)
    @PostMapping("/add")
@@ -162,6 +158,8 @@
        if(flag){
            return error("新增角色'" + dto.getRoleName() + "'失败,角色名称已存在");
        }
        Integer roleType = tokenService.getLoginUser().getUser().getRoleType();
        dto.setRoleType(roleType);
        roleService.saveRole(dto);
        return AjaxResult.success();
@@ -170,7 +168,7 @@
    /**
     * 修改保存角色
     */
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
//     @PreAuthorize("@ss.hasPermi('system:role:edit')")
    @ApiOperation(value = "编辑角色")
    @Log(title = "角色信息-编辑角色", businessType = BusinessType.UPDATE)
    @PutMapping