提交 9c494b4e 编写于 作者: F fengyw

feat: 优化验证码发送逻辑

上级 946f7705
...@@ -29,7 +29,7 @@ public class CacheRedis { ...@@ -29,7 +29,7 @@ public class CacheRedis {
public <T> T set(String key, T t) { public <T> T set(String key, T t) {
if (t != null) { if (t != null) {
String value = t.toString(); String value = t.toString();
if (!(t instanceof String)) { if (!(t instanceof String || t instanceof Long || t instanceof Integer)) {
value = JSUtil.toJsonString(t); value = JSUtil.toJsonString(t);
} }
stringRedisTemplate.opsForValue().set(key, value, timeToLive, TimeUnit.MILLISECONDS); stringRedisTemplate.opsForValue().set(key, value, timeToLive, TimeUnit.MILLISECONDS);
...@@ -43,7 +43,7 @@ public class CacheRedis { ...@@ -43,7 +43,7 @@ public class CacheRedis {
public <T> T set(String key, T t, int time, TimeUnit timeUnit) { public <T> T set(String key, T t, int time, TimeUnit timeUnit) {
if (t != null) { if (t != null) {
String value = t.toString(); String value = t.toString();
if (!(t instanceof String)) { if (!(t instanceof String || t instanceof Long || t instanceof Integer)) {
value = JSUtil.toJsonString(t); value = JSUtil.toJsonString(t);
} }
stringRedisTemplate.opsForValue().set(key, value, time, timeUnit); stringRedisTemplate.opsForValue().set(key, value, time, timeUnit);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册