审查视图

pkg/port/beego/routers/auth.go 711 字节
庄敏学 authored
1 2 3 4 5 6 7 8 9 10 11
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")
12 13
	web.Router("/login/mobile", &controllers.AuthController{}, "Post:MobileLogin")
	//
庄敏学 authored
14 15 16 17 18 19
	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")
}