fix: 修复企业端用户所有接口返回403的问题 — AdminAuth中间件白名单遗漏Enterprise类型
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m15s

This commit is contained in:
2026-03-31 10:41:31 +08:00
parent 2b408230a6
commit 4e65cf95d1

View File

@@ -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, "权限不足")
}