作者 RuoYi

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

@@ -68,12 +68,12 @@ public class RedisConfig extends CachingConfigurerSupport @@ -68,12 +68,12 @@ public class RedisConfig extends CachingConfigurerSupport
68 "local time = tonumber(ARGV[2])\n" + 68 "local time = tonumber(ARGV[2])\n" +
69 "local current = redis.call('get', key);\n" + 69 "local current = redis.call('get', key);\n" +
70 "if current and tonumber(current) > count then\n" + 70 "if current and tonumber(current) > count then\n" +
71 - " return current;\n" + 71 + " return tonumber(current);\n" +
72 "end\n" + 72 "end\n" +
73 "current = redis.call('incr', key)\n" + 73 "current = redis.call('incr', key)\n" +
74 "if tonumber(current) == 1 then\n" + 74 "if tonumber(current) == 1 then\n" +
75 " redis.call('expire', key, time)\n" + 75 " redis.call('expire', key, time)\n" +
76 "end\n" + 76 "end\n" +
77 - "return current;"; 77 + "return tonumber(current);";
78 } 78 }
79 } 79 }