소스 검색

feat:批量清缓存

wangchuanjin 1 년 전
부모
커밋
292f18add9
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      entity/user.go

+ 2 - 2
entity/user.go

@@ -275,9 +275,9 @@ func ClearUserPowerFunc(positionId, appId string) bool {
 		return false
 	}
 	for _, v := range strings.Split(positionId, ",") {
-		for _, v := range []string{"PC", "APP", "WX"} {
+		for _, vv := range []string{"PC", "APP", "WX"} {
 			//用户菜单缓存
-			redis.Del(RedisCode, fmt.Sprintf(RedisMenuKey, appId, v, ConfigJson.MenuCacheKey, v))
+			redis.Del(RedisCode, fmt.Sprintf(RedisMenuKey, appId, vv, ConfigJson.MenuCacheKey, v))
 		}
 		//用户权限缓存
 		redis.Del(RedisCode, fmt.Sprintf(UserPowerRedisKey, appId, time.Now().Day(), v))