From b2d360d9113b6955287108ca9e90d76a1f3c1419 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期日, 29 九月 2024 15:05:11 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia

---
 server/web/src/main/java/com/doumee/api/ScheduleTool.java |   31 ++-----------------------------
 1 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/server/web/src/main/java/com/doumee/api/ScheduleTool.java b/server/web/src/main/java/com/doumee/api/ScheduleTool.java
index 363cb0d..8fbf500 100644
--- a/server/web/src/main/java/com/doumee/api/ScheduleTool.java
+++ b/server/web/src/main/java/com/doumee/api/ScheduleTool.java
@@ -5,7 +5,6 @@
 import com.doumee.biz.system.SystemDictDataBiz;
 import com.doumee.core.utils.Constants;
 import com.doumee.core.utils.HttpsUtil;
-import com.doumee.core.wx.WXConstant;
 import com.doumee.dao.system.model.SystemDictData;
 import com.doumee.service.system.SystemDictDataService;
 import lombok.extern.slf4j.Slf4j;
@@ -35,11 +34,10 @@
  * @date 2021-10-10 14:40:35
  * https://www.bejson.com/othertools/cron/  cron 琛ㄨ揪寮忕敓鎴愬湴鍧�
  */
-//@Component
-//@EnableScheduling
+@Component
+@EnableScheduling
 @Slf4j
 public class ScheduleTool {
-
     @Autowired
     private SystemDictDataBiz systemDictDataBiz;
 
@@ -50,31 +48,6 @@
      */
     @Value("${debug_model}")
     private Boolean timing;
-
-    /**
-     * 鏇存柊寰俊鍏紬鍙� ACCESS_TOKEN
-     * @throws Exception
-     */
-    @Scheduled(fixedDelay=1000 * 60 * 90)
-    public void updAccessToken(){
-        DefaultSecurityManager securityManager = new DefaultSecurityManager();
-        SecurityUtils.setSecurityManager(securityManager);
-
-        String appId = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_APPID).getCode();
-        String appSecret = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_SECRET).getCode();
-        //鐢熸垚寰俊token
-        String url = WXConstant.GET_ACCESS_TOKEN_URL.replace("APPID",appId).replace("APPSECRET",appSecret);
-        String response = HttpsUtil.get(url,false);
-        JSONObject json = JSONObject.parseObject(response);
-        System.out.println(json);
-        SystemDictData systemDictData =  systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN);
-        if(!Objects.isNull(systemDictData)){
-            systemDictData.setCode(json.getString("access_token"));
-            systemDictData.setUpdateTime(new Date());
-            systemDictDataService.updateById(systemDictData);
-            log.info(" 鏇存柊寰俊鍏紬鍙� ACCESS_TOKEN =========> " + systemDictData.getCode() );
-        }
-    }
 
 
 

--
Gitblit v1.9.3