新增临时角色页面

This commit is contained in:
2025-02-24 21:25:49 +08:00
parent 53d1a19475
commit ec98add5b2
31 changed files with 194 additions and 66 deletions

View File

@@ -224,4 +224,13 @@ public class SysRoleController extends BaseController {
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
return R.ok(ajax);
}
/**
* 获取当前用户的role对象
*/
@GetMapping("/currentRole")
public R<SysRole> currentRole() {
return R.ok(roleService.getCurrentRole());
}
}

View File

@@ -263,4 +263,18 @@ public class SysUserController extends BaseController {
return R.ok(deptService.selectDeptTreeList(dept));
}
/**
* 用户授权角色
*
* @param userId 用户Id
*/
@SaCheckPermission("system:user:edit")
@Log(title = "用户管理", businessType = BusinessType.GRANT)
@GetMapping("/tempRole")
public R<Void> insertTempRole(Long userId) {
Long[] roleId = roleService.selectRoleByName();
userService.insertUserAuth(userId, roleId);
return R.ok();
}
}