Переглянути джерело

限流返回类型转换数值型的格式

RuoYi 3 роки тому
батько
коміт
f8cc7ce328

+ 2 - 2
ruoyi-framework/src/main/java/com/ruoyi/framework/config/RedisConfig.java

@@ -68,12 +68,12 @@ public class RedisConfig extends CachingConfigurerSupport
                 "local time = tonumber(ARGV[2])\n" +
                 "local current = redis.call('get', key);\n" +
                 "if current and tonumber(current) > count then\n" +
-                "    return current;\n" +
+                "    return tonumber(current);\n" +
                 "end\n" +
                 "current = redis.call('incr', key)\n" +
                 "if tonumber(current) == 1 then\n" +
                 "    redis.call('expire', key, time)\n" +
                 "end\n" +
-                "return current;";
+                "return tonumber(current);";
     }
 }