From a069244b57c64b18dc30399cd24adb6740bd5a1f Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 13 Sep 2024 17:55:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/hdl/hdl_set_center.go | 14 +++++++------- app/svc/svc_redis.go | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/hdl/hdl_set_center.go b/app/hdl/hdl_set_center.go index d87202a..e4d88f5 100644 --- a/app/hdl/hdl_set_center.go +++ b/app/hdl/hdl_set_center.go @@ -45,11 +45,11 @@ func SetOss(c *gin.Context) { sysCfgDb.SysCfgUpdate(enum.FileBucketHost, req.FileBucketHost) sysCfgDb.SysCfgUpdate(enum.FileBucketRegion, req.FileBucketRegion) sysCfgDb.SysCfgUpdate(enum.FileBucket, req.FileBucket) - svc.ClearRedis(c, enum.FileAccessKey) - svc.ClearRedis(c, enum.FileSecretKey) - svc.ClearRedis(c, enum.FileBucketHost) - svc.ClearRedis(c, enum.FileBucketRegion) - svc.ClearRedis(c, enum.FileBucket) + svc.ClearRedis(c, masterId, enum.FileAccessKey) + svc.ClearRedis(c, masterId, enum.FileSecretKey) + svc.ClearRedis(c, masterId, enum.FileBucketHost) + svc.ClearRedis(c, masterId, enum.FileBucketRegion) + svc.ClearRedis(c, masterId, enum.FileBucket) e.OutSuc(c, "success", nil) return } @@ -500,8 +500,8 @@ func SetMob(c *gin.Context) { sysCfgDb := implement2.NewSysCfgDb(engine, masterId) sysCfgDb.SysCfgUpdate("mob_app_key", req.MobAppKey) sysCfgDb.SysCfgUpdate("mob_app_secret", req.MobAppSecret) - svc.ClearRedis(c, "mob_app_key") - svc.ClearRedis(c, "mob_app_secret") + svc.ClearRedis(c, masterId, "mob_app_key") + svc.ClearRedis(c, masterId, "mob_app_secret") e.OutSuc(c, "success", nil) return } diff --git a/app/svc/svc_redis.go b/app/svc/svc_redis.go index b249105..23d92c4 100644 --- a/app/svc/svc_redis.go +++ b/app/svc/svc_redis.go @@ -6,7 +6,7 @@ import ( "github.com/gin-gonic/gin" ) -func ClearRedis(c *gin.Context, key string) { - key1 := fmt.Sprintf("%s:cfg_cache:%s", c.GetString("mid"), key) +func ClearRedis(c *gin.Context, masterId, key string) { + key1 := fmt.Sprintf("%s:cfg_cache:%s", masterId, key) cache.Del(key1) }