做几方面优化

This commit is contained in:
2026-09-25 00:27:15 +08:00
parent eafa5e1cf4
commit 92403171d4
14 changed files with 2142 additions and 258 deletions
+15 -4
View File
@@ -282,11 +282,22 @@ func (c *AuthOidcController) UserInfo() {
name = profile.Nickname
}
// 当前会话所在企业名称(一人多企业时必须是"已选中的那一家",
// 而非全部可进入企业;前端直接展示该字段,避免自行拼接 tenants)
tenantName := ""
for _, t := range profile.Tenants {
if t.Tid == uint64(claims.TenantId) {
tenantName = t.TenantName
break
}
}
c.serveJSON(map[string]interface{}{
"sub": fmt.Sprintf("%d", identity.ID),
"id": identity.ID,
"union_id": identity.UnionID,
"tid": claims.TenantId,
"sub": fmt.Sprintf("%d", identity.ID),
"id": identity.ID,
"union_id": identity.UnionID,
"tid": claims.TenantId,
"tenant_name": tenantName,
// 诊断用:业务接口按 user_type 判定权限(backend / app),
// 出现「无权访问」时可先看这里的值是否正确
"user_type": claims.UserType,