From dbe4f2962d5e28c6adfa76db3571a9bd414d8afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Wed, 22 Jul 2026 00:56:59 +0800 Subject: [PATCH] =?UTF-8?q?refactor(system):=20=E4=BC=98=E5=8C=96=E7=A7=9F?= =?UTF-8?q?=E6=88=B7=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86=E5=91=98=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将Tenant实体中的超级管理员用户ID字段名从superAdminUserId修改为ownerId - 更新字段的Schema描述,将“超级管理员用户ID”改为“超级管理员UID” - 修改TenantMapper.xml中关联查询SQL对应的字段别名为ownerId以保持一致 - 保持原有逻辑和功能不变,提升字段命名语义清晰度 --- .../common/system/controller/UserRoleController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gxwebsoft/common/system/controller/UserRoleController.java b/src/main/java/com/gxwebsoft/common/system/controller/UserRoleController.java index 692600a..4bc462a 100644 --- a/src/main/java/com/gxwebsoft/common/system/controller/UserRoleController.java +++ b/src/main/java/com/gxwebsoft/common/system/controller/UserRoleController.java @@ -63,9 +63,9 @@ public class UserRoleController extends BaseController { @Operation(summary = "添加用户角色") @PostMapping() public ApiResult save(@RequestBody UserRole userRole) { - // 记录当前登录用户id + // 记录当前登录用户id(请求体未指定 userId 时,回退到当前登录用户) User loginUser = getLoginUser(); - if (loginUser != null) { + if (userRole.getUserId() == null && loginUser != null) { userRole.setUserId(loginUser.getUserId()); } if (userRoleService.save(userRole)) {