From 954541c1da5f42305bfa50e06ec7947669234ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E5=90=89=E5=85=86?= <303176530@qq.com> Date: Tue, 14 Sep 2021 22:33:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?vue=20=E7=89=88=E6=9C=AC=203.0.0=20-->=203.?= =?UTF-8?q?2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/package.json b/web/package.json index b47b01e3..b32113d5 100644 --- a/web/package.json +++ b/web/package.json @@ -21,7 +21,7 @@ "screenfull": "^5.0.2", "script-ext-html-webpack-plugin": "^2.1.4", "spark-md5": "^3.0.1", - "vue": "^3.0.0", + "vue": "^3.2.0", "vue-particle-line": "^0.1.4", "vue-router": "^4.0.0-0", "vuex": "^4.0.0-0", From 3585537812cc20015b6adcae2d7ac8e9eb9bb7bd Mon Sep 17 00:00:00 2001 From: songzhibin97 <718428482@qq.com> Date: Wed, 15 Sep 2021 11:53:39 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20cache=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/core/viper.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/server/core/viper.go b/server/core/viper.go index bbcfd364..43e270b6 100644 --- a/server/core/viper.go +++ b/server/core/viper.go @@ -7,8 +7,6 @@ import ( "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" @@ -51,7 +49,7 @@ func Viper(path ...string) *viper.Viper { v.OnConfigChange(func(e fsnotify.Event) { fmt.Println("config file changed:", e.Name) - if err := v.Unmarshal(&global.GVA_CONFIG); err != nil { + if err = v.Unmarshal(&global.GVA_CONFIG); err != nil { fmt.Println(err) } }) @@ -60,10 +58,6 @@ func Viper(path ...string) *viper.Viper { } 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() - } + local_cache.SetDefaultExpire(time.Second * time.Duration(global.GVA_CONFIG.JWT.ExpiresTime))) return v } From 2d7afc16d396537e807c93b82016557d6e7063a7 Mon Sep 17 00:00:00 2001 From: Benny Date: Wed, 15 Sep 2021 12:04:02 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=E5=9C=A8GVA=5FDB=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E5=90=8E=EF=BC=8C=E4=BB=8Edb=E5=8A=A0=E8=BD=BDjwt?= =?UTF-8?q?=E9=BB=91=E5=90=8D=E5=8D=95=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/core/server.go | 7 +++++++ server/core/viper.go | 7 +------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/server/core/server.go b/server/core/server.go index 6f30d54d..e11b3419 100644 --- a/server/core/server.go +++ b/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/initialize" + "github.com/flipped-aurora/gin-vue-admin/server/service/system" "go.uber.org/zap" ) @@ -18,6 +19,12 @@ func RunWindowsServer() { // 初始化redis服务 initialize.Redis() } + + // 从db加载jwt数据 + if global.GVA_DB != nil { + system.LoadAll() + } + Router := initialize.Routers() Router.Static("/form-generator", "./resource/page") diff --git a/server/core/viper.go b/server/core/viper.go index bbcfd364..22ad5263 100644 --- a/server/core/viper.go +++ b/server/core/viper.go @@ -7,8 +7,6 @@ import ( "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" @@ -61,9 +59,6 @@ func Viper(path ...string) *viper.Viper { 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 }