更新缓存和文件分类
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user