auth.go
627 字节
package routers
import (
"github.com/beego/beego/v2/server/web"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/controllers"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/middlewares"
)
func init() {
web.Router("/login", &controllers.AuthController{}, "Post:Login")
web.InsertFilter("/auth/admin/*", web.BeforeExec, middlewares.CheckAdminToken())
web.Router("/auth/admin/user", &controllers.AuthController{}, "Get:User")
web.InsertFilter("/auth/font/*", web.BeforeExec, middlewares.CheckFontToken())
web.Router("/auth/font/user", &controllers.AuthController{}, "Get:User")
}