Bladeren bron

feature: 自助服务
1.短信登录token缓存设置24小时失效

luoyb 1 jaar geleden
bovenliggende
commit
e1dcb87b3a

+ 2 - 1
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/business/self/SelfBusiness.java

@@ -28,6 +28,7 @@ import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.text.MessageFormat;
+import java.time.Duration;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -78,7 +79,7 @@ public class SelfBusiness {
             log.info("[短信平台登录]-{}", JSONUtil.toJsonStr(result));
             if(result.isSuccess()){
                 RedisUtils.deleteObject("yktSmsToken");
-                RedisUtils.setCacheObject("yktSmsToken", result.getData().toString());
+                RedisUtils.setCacheObject("yktSmsToken", result.getData().toString(), Duration.ofHours(24));
             }
         } catch (Exception e){
             log.error("登录短信平台失败,{}", e.getMessage());