作者 庄敏学

fixed

@@ -2,12 +2,14 @@ package routers @@ -2,12 +2,14 @@ package routers
2 2
3 import ( 3 import (
4 "github.com/beego/beego/v2/server/web" 4 "github.com/beego/beego/v2/server/web"
  5 + "github.com/linmadan/egglib-go/web/beego/filters"
5 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/controllers" 6 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/controllers"
  7 + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/middlewares"
6 ) 8 )
7 9
8 func init() { 10 func init() {
9 ns := web.NewNamespace("/v1/import", 11 ns := web.NewNamespace("/v1/import",
10 - //web.NSBefore(filters.AllowCors(), middlewares.CheckAdminToken()), 12 + web.NSBefore(filters.AllowCors(), middlewares.CheckAdminToken()),
11 web.NSRouter("/", &controllers.ImportController{}, "Post:Import"), 13 web.NSRouter("/", &controllers.ImportController{}, "Post:Import"),
12 ) 14 )
13 web.AddNamespace(ns) 15 web.AddNamespace(ns)