整理配置文件,jwt过期时间和缓冲时间支持1d2h3m4s事件类型 (#1218)

* feat: human duration

* Update config.yaml

* 调整配置文件结构

Co-authored-by: songzhibin97 <718428482@qq.com>
This commit is contained in:
奇淼(piexlmax
2022-09-13 16:26:02 +08:00
committed by GitHub
parent ee7b9b0cff
commit b5c79be625
10 changed files with 143 additions and 94 deletions

View File

@@ -0,0 +1,23 @@
package initialize
import (
"github.com/songzhibin97/gkit/cache/local_cache"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
)
func OtherInit() {
dr, err := utils.ParseDuration(global.GVA_CONFIG.JWT.ExpiresTime)
if err != nil {
panic(err)
}
_, err = utils.ParseDuration(global.GVA_CONFIG.JWT.BufferTime)
if err != nil {
panic(err)
}
global.BlackCache = local_cache.NewCache(
local_cache.SetDefaultExpire(dr),
)
}