refactor(system): 优化租户超级管理员字段命名
- 将Tenant实体中的超级管理员用户ID字段名从superAdminUserId修改为ownerId - 更新字段的Schema描述,将“超级管理员用户ID”改为“超级管理员UID” - 修改TenantMapper.xml中关联查询SQL对应的字段别名为ownerId以保持一致 - 保持原有逻辑和功能不变,提升字段命名语义清晰度
This commit is contained in:
@@ -63,9 +63,9 @@ public class UserRoleController extends BaseController {
|
|||||||
@Operation(summary = "添加用户角色")
|
@Operation(summary = "添加用户角色")
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ApiResult<?> save(@RequestBody UserRole userRole) {
|
public ApiResult<?> save(@RequestBody UserRole userRole) {
|
||||||
// 记录当前登录用户id
|
// 记录当前登录用户id(请求体未指定 userId 时,回退到当前登录用户)
|
||||||
User loginUser = getLoginUser();
|
User loginUser = getLoginUser();
|
||||||
if (loginUser != null) {
|
if (userRole.getUserId() == null && loginUser != null) {
|
||||||
userRole.setUserId(loginUser.getUserId());
|
userRole.setUserId(loginUser.getUserId());
|
||||||
}
|
}
|
||||||
if (userRoleService.save(userRole)) {
|
if (userRoleService.save(userRole)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user