feat:black jwt

This commit is contained in:
songzhibin97
2021-09-01 18:40:06 +08:00
parent 20876243ed
commit 14fd932829
4 changed files with 37 additions and 7 deletions
+11
View File
@@ -5,6 +5,11 @@ import (
"fmt"
"os"
"path/filepath"
"time"
"github.com/flipped-aurora/gin-vue-admin/server/service/system"
"github.com/songzhibin97/gkit/cache/local_cache"
"github.com/flipped-aurora/gin-vue-admin/server/global"
_ "github.com/flipped-aurora/gin-vue-admin/server/packfile"
@@ -54,5 +59,11 @@ func Viper(path ...string) *viper.Viper {
fmt.Println(err)
}
global.GVA_CONFIG.AutoCode.Root, _ = filepath.Abs("..")
global.BlackCache = local_cache.NewCache(
local_cache.SetDefaultExpire(time.Duration(global.GVA_CONFIG.JWT.ExpiresTime)))
// 从db加载jwt数据
if global.GVA_DB != nil {
system.LoadAll()
}
return v
}