修改文件目录
This commit is contained in:
1 parent
41b06c806a
commit
01ea376015
109 files changed
+180
-172
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"go-admin/app/admin/middleware/handler"
|
||||
jwt "go-admin/pkg/jwtauth"
|
||||
"go-admin/tools/config"
|
||||
)
|
||||
|
||||
func AuthInit() (*jwt.GinJWTMiddleware, error) {
|
||||
return jwt.New(&jwt.GinJWTMiddleware{
|
||||
Realm: "test zone",
|
||||
Key: []byte(config.ApplicationConfig.JwtSecret),
|
||||
Timeout: time.Hour,
|
||||
MaxRefresh: time.Hour,
|
||||
PayloadFunc: handler.PayloadFunc,
|
||||
IdentityHandler: handler.IdentityHandler,
|
||||
Authenticator: handler.Authenticator,
|
||||
Authorizator: handler.Authorizator,
|
||||
Unauthorized: handler.Unauthorized,
|
||||
TokenLookup: "header: Authorization, query: token, cookie: jwt",
|
||||
TokenHeadName: "Bearer",
|
||||
TimeFunc: time.Now,
|
||||
})
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user