feat(user): 改为动态查询 VIP 角色ID,避免写死角色ID

- RoleParam 类型新增 tenantId 字段,支持按租户过滤角色
- 新增 getCurrentTenantId 获取当前租户ID,支持登录态和默认租户回退
- 实现 getVipRoleId 函数,按 roleCode 与 tenantId 查询 VIP 角色ID
- assignVipRole 中动态获取 VIP 角色ID,避免硬编码
- 添加用户角色时带上 tenantId,确保多租户角色绑定正确
- 移除写死的 VIP_ROLE_ID,改用动态查询结果,提高跨租户兼容性
- 补充引入 listRoles 和 TenantId,完善相关依赖引用
This commit is contained in:
2026-07-21 21:07:08 +08:00
parent 43093b505b
commit eeb63efe9f
4 changed files with 56 additions and 18 deletions
+2
View File
@@ -24,4 +24,6 @@ export interface RoleParam extends PageParam {
roleName?: string;
roleCode?: string;
comments?: string;
// 租户ID(多租户隔离:按租户查询角色)
tenantId?: number | string;
}