From ad8c27bc0992c30f44991dba9f0d4283c03324f4 Mon Sep 17 00:00:00 2001 From: songzhibin97 <718428482@qq.com> Date: Mon, 13 Sep 2021 11:07:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E9=87=8D=E5=A4=8D=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/service/system/sys_autocode_history.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/service/system/sys_autocode_history.go b/server/service/system/sys_autocode_history.go index c222a004..4bce5d02 100644 --- a/server/service/system/sys_autocode_history.go +++ b/server/service/system/sys_autocode_history.go @@ -25,7 +25,7 @@ var AutoCodeHistoryServiceApp = new(AutoCodeHistoryService) func (autoCodeHistoryService *AutoCodeHistoryService) Repeat(structName string) bool { var count int64 - global.GVA_DB.Model(&system.SysAutoCodeHistory{}).Where("struct_name = ?", structName).Count(&count) + global.GVA_DB.Model(&system.SysAutoCodeHistory{}).Where("struct_name = ? and flag = 0", structName).Count(&count) return count > 0 } From ecc657d489a167863d3aef22a5157aa225329d14 Mon Sep 17 00:00:00 2001 From: songzhibin97 <718428482@qq.com> Date: Tue, 14 Sep 2021 16:26:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:jwt=E7=AD=BE=E5=90=8D=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/service/system/sys_initdb.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/service/system/sys_initdb.go b/server/service/system/sys_initdb.go index a0a768e5..45d3b747 100644 --- a/server/service/system/sys_initdb.go +++ b/server/service/system/sys_initdb.go @@ -5,6 +5,8 @@ import ( "fmt" "path/filepath" + uuid "github.com/satori/go.uuid" + "github.com/flipped-aurora/gin-vue-admin/server/config" "github.com/flipped-aurora/gin-vue-admin/server/global" "github.com/flipped-aurora/gin-vue-admin/server/model/example" @@ -33,6 +35,7 @@ func (initDBService *InitDBService) writeConfig(viper *viper.Viper, mysql config for k, v := range cs { viper.Set(k, v) } + viper.Set("jwt.signing-key", uuid.NewV4()) return viper.WriteConfig() } @@ -159,6 +162,7 @@ func (initDBService *InitDBService) InitDB(conf request.InitDB) error { global.GVA_DB = nil return err } + if err = initDBService.writeConfig(global.GVA_VP, MysqlConfig); err != nil { return err }