heheng
7 天以前 d8012ee77b6a9e86611aae9074d5925826f4210d
multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/SysRoleController.java
@@ -10,6 +10,7 @@
import com.gkhy.exam.common.domain.model.LoginUser;
import com.gkhy.exam.common.domain.model.LoginUserDetails;
import com.gkhy.exam.common.enums.BusinessType;
import com.gkhy.exam.common.utils.SecurityUtils;
import com.gkhy.exam.framework.web.service.SysPermissionService;
import com.gkhy.exam.framework.web.service.TokenService;
import com.gkhy.exam.system.domain.SysUserRole;
@@ -53,7 +54,7 @@
//    @Autowired
//    private ISysDeptService deptService;
    @PreAuthorize("@ss.hasPermi('system:role:list')")
    // @PreAuthorize("hasAnyAuthority('system:role:list')")
    @GetMapping("/list")
    public CommonResult list(SysRole role)
    {
@@ -62,7 +63,7 @@
    }
//    @Log(title = "角色管理", businessType = BusinessType.EXPORT)
//    @PreAuthorize("@ss.hasPermi('system:role:export')")
//    @PreAuthorize("hasAnyAuthority('system:role:export')")
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, SysRole role)
//    {
@@ -74,7 +75,7 @@
    /**
     * 根据角色编号获取详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:role:query')")
    //@PreAuthorize("hasAnyAuthority('system:role:query')")
    @GetMapping(value = "/{roleId}")
    public CommonResult getInfo(@PathVariable Long roleId)
    {
@@ -85,8 +86,8 @@
    /**
     * 新增角色
     */
    @PreAuthorize("@ss.hasPermi('system:role:add')")
    @Log(title = "角色管理", businessType = BusinessType.INSERT)
    //@PreAuthorize("hasAnyAuthority('system:role:add')")
    //@Log(title = "角色管理", businessType = BusinessType.INSERT)
    @PostMapping
    public CommonResult add(@Validated @RequestBody SysRole role)
    {
@@ -106,8 +107,8 @@
    /**
     * 修改保存角色
     */
    @PreAuthorize("@ss.hasPermi('system:role:edit')")
    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
    //@PreAuthorize("hasAnyAuthority('system:role:edit')")
    //@Log(title = "角色管理", businessType = BusinessType.UPDATE)
    @PutMapping
    public CommonResult edit(@Validated @RequestBody SysRole role)
    {
@@ -128,7 +129,7 @@
            // 更新缓存用户权限
            LoginUserDetails loginUser = getLoginUser();
            if (ObjectUtil.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
            if (ObjectUtil.isNotNull(loginUser.getUser()) && !SecurityUtils.adminUser())
            {
                loginUser.setUser(userService.selectUserByUsername(loginUser.getUser().getName()));
                loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
@@ -142,8 +143,8 @@
    /**
     * 修改保存数据权限
     */
    @PreAuthorize("@ss.hasPermi('system:role:edit')")
    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
    //@PreAuthorize("hasAnyAuthority('system:role:edit')")
    //@Log(title = "角色管理", businessType = BusinessType.UPDATE)
    @PutMapping("/dataScope")
    public CommonResult dataScope(@RequestBody SysRole role)
    {
@@ -155,8 +156,8 @@
    /**
     * 状态修改
     */
    @PreAuthorize("@ss.hasPermi('system:role:edit')")
    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
    //@PreAuthorize("hasAnyAuthority('system:role:edit')")
    // @Log(title = "角色管理", businessType = BusinessType.UPDATE)
    @PutMapping("/changeStatus")
    public CommonResult changeStatus(@RequestBody SysRole role)
    {
@@ -169,7 +170,7 @@
    /**
     * 删除角色
     */
    @PreAuthorize("@ss.hasPermi('system:role:remove')")
    //@PreAuthorize("hasAnyAuthority('system:role:remove')")
    @Log(title = "角色管理", businessType = BusinessType.DELETE)
    @DeleteMapping("/{roleIds}")
    public CommonResult remove(@PathVariable Long[] roleIds)
@@ -180,7 +181,7 @@
    /**
     * 获取角色选择框列表
     */
    @PreAuthorize("@ss.hasPermi('system:role:query')")
    //@PreAuthorize("hasAnyAuthority('system:role:query')")
    @GetMapping("/optionselect")
    public CommonResult optionselect()
    {
@@ -190,7 +191,7 @@
    /**
     * 查询已分配用户角色列表
     */
    @PreAuthorize("@ss.hasPermi('system:role:list')")
    //@PreAuthorize("hasAnyAuthority('system:role:list')")
    @GetMapping("/authUser/allocatedList")
    public CommonResult allocatedList(SysUser user)
    {
@@ -202,7 +203,7 @@
    /**
     * 查询未分配用户角色列表
     */
    @PreAuthorize("@ss.hasPermi('system:role:list')")
    //@PreAuthorize("hasAnyAuthority('system:role:list')")
    @GetMapping("/authUser/unallocatedList")
    public CommonResult unallocatedList(SysUser user)
    {
@@ -214,7 +215,7 @@
    /**
     * 取消授权用户
     */
    @PreAuthorize("@ss.hasPermi('system:role:edit')")
    //@PreAuthorize("hasAnyAuthority('system:role:edit')")
    @Log(title = "角色管理", businessType = BusinessType.GRANT)
    @PutMapping("/authUser/cancel")
    public CommonResult cancelAuthUser(@RequestBody SysUserRole userRole)
@@ -225,7 +226,7 @@
    /**
     * 批量取消授权用户
     */
    @PreAuthorize("@ss.hasPermi('system:role:edit')")
    //@PreAuthorize("hasAnyAuthority('system:role:edit')")
    @Log(title = "角色管理", businessType = BusinessType.GRANT)
    @PutMapping("/authUser/cancelAll")
    public CommonResult cancelAuthUserAll(Long roleId, Long[] userIds)
@@ -236,7 +237,7 @@
    /**
     * 批量选择用户授权
     */
    @PreAuthorize("@ss.hasPermi('system:role:edit')")
    //@PreAuthorize("hasAnyAuthority('system:role:edit')")
    @Log(title = "角色管理", businessType = BusinessType.GRANT)
    @PutMapping("/authUser/selectAll")
    public CommonResult selectAuthUserAll(Long roleId, Long[] userIds)
@@ -248,7 +249,7 @@
    /**
     * 获取对应角色部门树列表
     */
    @PreAuthorize("@ss.hasPermi('system:role:query')")
    //@PreAuthorize("hasAnyAuthority('system:role:query')")
    @GetMapping(value = "/deptTree/{roleId}")
    public CommonResult deptTree(@PathVariable("roleId") Long roleId)
    {