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

feat: 优化验证码发送逻辑

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