允许代理看
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 10m11s

This commit is contained in:
2026-05-09 11:03:32 +08:00
parent 0b86720534
commit 6a6672d0e4
3 changed files with 41 additions and 4 deletions

View File

@@ -12,11 +12,13 @@ import (
)
// registerRefundRoutes 注册退款管理路由
// 平台用户(超级管理员和平台用户)可访问
// 平台和代理账号可访问,企业账号禁止访问
func registerRefundRoutes(router fiber.Router, handler *admin.RefundHandler, doc *openapi.Generator, basePath string) {
refund := router.Group("/refunds", func(c *fiber.Ctx) error {
userType := middleware.GetUserTypeFromContext(c.UserContext())
if userType != constants.UserTypeSuperAdmin && userType != constants.UserTypePlatform {
if userType != constants.UserTypeSuperAdmin &&
userType != constants.UserTypePlatform &&
userType != constants.UserTypeAgent {
return errors.New(errors.CodeForbidden, "无权限访问退款管理功能")
}
return c.Next()