auth.go 1012 字节
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.Router("/login/mobile", &controllers.AuthController{}, "Post:MobileLogin")

	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")

	{
		//手机模块登录-新
		web.CtrlPost("/v1/auth/authorize", (*controllers.AuthController).Authorize)
		web.CtrlPost("/v1/auth/accessToken", (*controllers.AuthController).AccessToken)
		web.CtrlPost("/v1/auth/refreshToken", (*controllers.AuthController).RefreshToken)
	}

}