This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user