# 2026-07-22 ## 修复 UserRoleController.save 覆盖 userId 的 bug - 文件:`com.gxwebsoft.core/.../system/controller/UserRoleController.java` - 问题:原 `save` 用 `getLoginUser().getUserId()` **无条件覆盖**请求体 userId,导致 VIP 审核通过时角色绑到店员而非申请人。 - 修复:改为 `if (userRole.getUserId() == null && loginUser != null) userRole.setUserId(loginUser.getUserId());`(仅当请求体未传 userId 时回退到登录用户)。 - 影响:VIP 审核 `addUserRole({ userId: item.userId, ... })` 现在能正确把角色绑给申请人;其它不传 userId 的调用方行为不变。 - 注意:UserRole 的 `tenantId` 由 MyBatis-Plus 多租户插件按请求头自动写入 INSERT,前端传的 tenantId 仅作冗余。