feat: switch to global auth and tenant route prefix

This commit is contained in:
2026-01-26 18:04:05 +08:00
parent 8addf6f900
commit cde4fb8594
25 changed files with 479 additions and 7196 deletions

View File

@@ -64,10 +64,7 @@ func (s *user) LoginWithOTP(ctx context.Context, tenantID int64, phone, otp stri
if u.Status == consts.UserStatusBanned {
return nil, errorx.ErrAccountDisabled
}
// 4. 校验租户成员关系租户上下文下仅允许成员登录)
if err := s.ensureTenantMember(ctx, tenantID, u.ID); err != nil {
return nil, err
}
// 4. 登录不校验租户成员关系租户资源访问时再校验权限
// 5. 生成 Token
token, err := s.jwt.CreateToken(s.jwt.CreateClaims(jwt.BaseClaims{