From f99f62633183f65499b9a2087eac59dd32fa0ef5 Mon Sep 17 00:00:00 2001 From: songzhibin97 <718428482@qq.com> Date: Wed, 4 Aug 2021 14:25:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=E5=9B=9E=E6=BB=9A=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E5=88=B0=E5=9E=83=E5=9C=BE=E6=A1=B6,?= =?UTF-8?q?=E5=B9=B6=E9=9D=9E=E7=9B=B4=E6=8E=A5=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/go.mod | 2 -- server/service/system/sys_autocode_history.go | 13 ++++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/server/go.mod b/server/go.mod index 1dcc8ef4..19c98309 100644 --- a/server/go.mod +++ b/server/go.mod @@ -10,7 +10,6 @@ require ( github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect github.com/casbin/casbin/v2 v2.11.0 github.com/casbin/gorm-adapter/v3 v3.0.2 - github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect github.com/fsnotify/fsnotify v1.4.9 @@ -37,7 +36,6 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/qiniu/api.v7/v7 v7.4.1 github.com/robfig/cron/v3 v3.0.1 - github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/satori/go.uuid v1.2.0 github.com/shirou/gopsutil v3.21.1+incompatible github.com/spf13/afero v1.2.2 // indirect diff --git a/server/service/system/sys_autocode_history.go b/server/service/system/sys_autocode_history.go index 8a70da78..1a9770a1 100644 --- a/server/service/system/sys_autocode_history.go +++ b/server/service/system/sys_autocode_history.go @@ -1,11 +1,14 @@ package system import ( + "fmt" "gin-vue-admin/global" "gin-vue-admin/model/common/request" "gin-vue-admin/model/system" "gin-vue-admin/utils" + "path/filepath" "strings" + "time" "go.uber.org/zap" ) @@ -55,8 +58,16 @@ func (autoCodeHistoryService *AutoCodeHistoryService) RollBack(id uint) error { } } // 删除文件 + for _, path := range strings.Split(md.AutoCodePath, ";") { - _ = utils.DeLFile(path) + // 迁移 + nPath := filepath.Join(global.GVA_CONFIG.AutoCode.Root, + "rm_file", time.Now().Format("20060102"), filepath.Base(filepath.Dir(filepath.Dir(path))), filepath.Base(filepath.Dir(path)), filepath.Base(path)) + err = utils.FileMove(path, nPath) + if err != nil { + fmt.Println(">>>>>>>>>>>>>>>>>>>", err) + } + //_ = utils.DeLFile(path) } // 清除注入 for _, v := range strings.Split(md.InjectionMeta, ";") { From 1a53a80e4f7805e4133dd0b7a99366125238714e Mon Sep 17 00:00:00 2001 From: piexlmax <303176530@qq.com> Date: Thu, 5 Aug 2021 17:44:04 +0800 Subject: [PATCH 2/2] redis-->redis/v8 --- server/api/v1/system/sys_user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/v1/system/sys_user.go b/server/api/v1/system/sys_user.go index 6db0c34f..4aae5b69 100644 --- a/server/api/v1/system/sys_user.go +++ b/server/api/v1/system/sys_user.go @@ -14,7 +14,7 @@ import ( "github.com/dgrijalva/jwt-go" "github.com/gin-gonic/gin" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "go.uber.org/zap" )