mirror of
https://github.com/tiger1103/gfast.git
synced 2026-09-21 18:20:47 +00:00
登陆验证功能
This commit is contained in:
+12
-1
@@ -1,8 +1,19 @@
|
||||
package boot
|
||||
|
||||
import "github.com/gogf/gf/frame/g"
|
||||
import (
|
||||
"github.com/goflyfox/gtoken/gtoken"
|
||||
"github.com/gogf/gf/frame/g"
|
||||
)
|
||||
|
||||
func init() {
|
||||
g.Server().SetPort(8200)
|
||||
g.Server().AddStaticPath("/public", g.Cfg().Get("server.ServerRoot").(string))
|
||||
// 启动gtoken
|
||||
gtoken := >oken.GfToken{
|
||||
LoginPath: "/login",
|
||||
LoginBeforeFunc: loginFunc,
|
||||
LogoutPath: "/user/logout",
|
||||
AuthPaths: g.SliceStr{"/system/*"},
|
||||
}
|
||||
gtoken.Start()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user