更新缓存和文件分类

This commit is contained in:
2025-11-06 17:12:13 +08:00
parent 873a2e297a
commit f4244c09b9
6 changed files with 171 additions and 23 deletions
+10
View File
@@ -127,9 +127,19 @@ func (c *RoleController) GetRoleByTenantId() {
return
}
// 获取当前登录用户类型(从JWT中间件获取)
userType, _ := c.Ctx.Input.GetData("userType").(string)
isEmployee := userType == "employee"
// 转换为前端需要的格式,确保包含 tenantId 和 default 字段
// 如果是租户登录(employee),过滤掉 default=1 的角色
roleList := make([]map[string]interface{}, 0)
for _, role := range roles {
// 如果是租户登录,且角色的 default=1,则跳过(不显示)
if isEmployee && role.Default == 1 {
continue
}
roleList = append(roleList, map[string]interface{}{
"roleId": role.RoleId,
"tenantId": role.TenantId,