From 4e65cf95d1935e31e3c125d9a7a9655707176154 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 31 Mar 2026 10:41:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E7=AB=AF=E7=94=A8=E6=88=B7=E6=89=80=E6=9C=89=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=BF=94=E5=9B=9E403=E7=9A=84=E9=97=AE=E9=A2=98=20=E2=80=94=20?= =?UTF-8?q?AdminAuth=E4=B8=AD=E9=97=B4=E4=BB=B6=E7=99=BD=E5=90=8D=E5=8D=95?= =?UTF-8?q?=E9=81=97=E6=BC=8FEnterprise=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/bootstrap/middlewares.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/bootstrap/middlewares.go b/internal/bootstrap/middlewares.go index c46be2a..971d446 100644 --- a/internal/bootstrap/middlewares.go +++ b/internal/bootstrap/middlewares.go @@ -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, "权限不足") }