Browse Source

Merge pull request #704 from iciness/develop

bug修复:jwt黑名单启动时候未加载及未生效
main
奇淼(piexlmax 3 years ago
committed by GitHub
parent
commit
b54a51b49e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      server/core/server.go
  2. 7
      server/core/viper.go

7
server/core/server.go

@ -6,6 +6,7 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/global" "github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/initialize" "github.com/flipped-aurora/gin-vue-admin/server/initialize"
"github.com/flipped-aurora/gin-vue-admin/server/service/system"
"go.uber.org/zap" "go.uber.org/zap"
) )
@ -18,6 +19,12 @@ func RunWindowsServer() {
// 初始化redis服务 // 初始化redis服务
initialize.Redis() initialize.Redis()
} }
// 从db加载jwt数据
if global.GVA_DB != nil {
system.LoadAll()
}
Router := initialize.Routers() Router := initialize.Routers()
Router.Static("/form-generator", "./resource/page") Router.Static("/form-generator", "./resource/page")

7
server/core/viper.go

@ -7,8 +7,6 @@ import (
"path/filepath" "path/filepath"
"time" "time"
"github.com/flipped-aurora/gin-vue-admin/server/service/system"
"github.com/songzhibin97/gkit/cache/local_cache" "github.com/songzhibin97/gkit/cache/local_cache"
"github.com/flipped-aurora/gin-vue-admin/server/global" "github.com/flipped-aurora/gin-vue-admin/server/global"
@ -61,9 +59,6 @@ func Viper(path ...string) *viper.Viper {
global.GVA_CONFIG.AutoCode.Root, _ = filepath.Abs("..") global.GVA_CONFIG.AutoCode.Root, _ = filepath.Abs("..")
global.BlackCache = local_cache.NewCache( global.BlackCache = local_cache.NewCache(
local_cache.SetDefaultExpire(time.Duration(global.GVA_CONFIG.JWT.ExpiresTime))) local_cache.SetDefaultExpire(time.Duration(global.GVA_CONFIG.JWT.ExpiresTime)))
// 从db加载jwt数据
if global.GVA_DB != nil {
system.LoadAll()
}
return v return v
} }
Loading…
Cancel
Save