作者 yangfu

修改:jwt过滤修改

... ... @@ -11,4 +11,7 @@ func init() {
beego.InsertFilter("/*", beego.BeforeExec, middleware.CreateRequestBodyFilter())
beego.InsertFilter("/*", beego.BeforeExec, middleware.CreateRequstLogFilter(Logger))
beego.InsertFilter("/*", beego.AfterExec, middleware.CreateResponseLogFilter(Logger), false)
beego.InsertFilter("/v1", beego.BeforeExec, middleware.CheckJWTToken)
beego.InsertFilter("/v2", beego.BeforeExec, middleware.CheckJWTToken)
}
... ...
... ... @@ -3,11 +3,10 @@ package routers
import (
"github.com/astaxie/beego"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr/controllers"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr/middleware"
)
func init() {
nsV1 := beego.NewNamespace("v1", beego.NSBefore(middleware.CheckJWTToken)) //beego.NSNamespace("auth", beego.NSInclude(&controllers.AuthController{}))
nsV1 := beego.NewNamespace("v1") //, beego.NSBefore(middleware.CheckJWTToken)
nsV1.Router("/auth/login", &controllers.AuthController{}, "Post:Login")
nsV1.Router("/auth/smsCode", &controllers.AuthController{}, "Post:SmsCode")
nsV1.Router("/auth/accessToken", &controllers.AuthController{}, "Post:AccessToken")
... ... @@ -43,7 +42,7 @@ func init() {
}
func InitV2() {
nsV2 := beego.NewNamespace("v2", beego.NSBefore(middleware.CheckJWTToken)) // ,
nsV2 := beego.NewNamespace("v2") // ,, beego.NSBefore(middleware.CheckJWTToken)
nsV2.Router("/auth/login", &controllers.AuthController{}, "Post:LoginV2")
nsV2.Router("/user/userInfo", &controllers.UserController{}, "Post:UserInfoV2")
beego.AddNamespace(nsV2)
... ...