fix: 修复企业端用户所有接口返回403的问题 — AdminAuth中间件白名单遗漏Enterprise类型
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m15s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m15s
This commit is contained in:
@@ -46,10 +46,11 @@ func createAdminAuthMiddleware(tokenManager *pkgauth.TokenManager, shopStore pkg
|
||||
return nil, errors.New(errors.CodeInvalidToken, "认证令牌无效或已过期")
|
||||
}
|
||||
|
||||
// 检查用户类型:后台允许 SuperAdmin(1), Platform(2), Agent(3)
|
||||
// 检查用户类型:后台允许 SuperAdmin(1), Platform(2), Agent(3), Enterprise(4)
|
||||
if tokenInfo.UserType != constants.UserTypeSuperAdmin &&
|
||||
tokenInfo.UserType != constants.UserTypePlatform &&
|
||||
tokenInfo.UserType != constants.UserTypeAgent {
|
||||
tokenInfo.UserType != constants.UserTypeAgent &&
|
||||
tokenInfo.UserType != constants.UserTypeEnterprise {
|
||||
return nil, errors.New(errors.CodeForbidden, "权限不足")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user