From 898e017dade9317f1cc769d38228ba79710942a9 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 13 Sep 2024 18:05:00 +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 | 2 ++ app/svc/svc_redis.go | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/app/hdl/hdl_set_center.go b/app/hdl/hdl_set_center.go index e4d88f5..14fff43 100644 --- a/app/hdl/hdl_set_center.go +++ b/app/hdl/hdl_set_center.go @@ -50,6 +50,7 @@ func SetOss(c *gin.Context) { svc.ClearRedis(c, masterId, enum.FileBucketHost) svc.ClearRedis(c, masterId, enum.FileBucketRegion) svc.ClearRedis(c, masterId, enum.FileBucket) + svc.ClearAllRedis(c, masterId) e.OutSuc(c, "success", nil) return } @@ -502,6 +503,7 @@ func SetMob(c *gin.Context) { sysCfgDb.SysCfgUpdate("mob_app_secret", req.MobAppSecret) svc.ClearRedis(c, masterId, "mob_app_key") svc.ClearRedis(c, masterId, "mob_app_secret") + svc.ClearAllRedis(c, masterId) e.OutSuc(c, "success", nil) return } diff --git a/app/svc/svc_redis.go b/app/svc/svc_redis.go index 23d92c4..a106438 100644 --- a/app/svc/svc_redis.go +++ b/app/svc/svc_redis.go @@ -9,4 +9,14 @@ import ( func ClearRedis(c *gin.Context, masterId, key string) { key1 := fmt.Sprintf("%s:cfg_cache:%s", masterId, key) cache.Del(key1) + +} + +func ClearAllRedis(c *gin.Context, masterId string) { + var str = []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "%!s(MISSING)"} + + for _, v := range str { + key1 := fmt.Sprintf("%s:cfg_cache:%s", masterId, v) + cache.Del(key1) + } }