feat:In the development mode, the token timeout is adjusted to infinity(#169)

This commit is contained in:
zhangwenjian committed 2020-07-18 14:59:21 +08:00
1 parent d4d4c9f574
commit 3af05af603
1 file changed
+5
+5
View File
@@ -288,6 +288,11 @@ func (mw *GinJWTMiddleware) MiddlewareInit() error {
mw.Timeout = time.Duration(config2.JwtConfig.Timeout) * time.Second
}
if config2.ApplicationConfig.Mode == "dev" {
// TODO: dev mode token过期时长 为 100 年
mw.Timeout = time.Duration(8760100) * time.Hour
}
if mw.TimeFunc == nil {
mw.TimeFunc = time.Now
}