From bbff55be46004d8973fc6fceee1586e6bf7f0a6b Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 27 八月 2024 15:53:00 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia
---
server/service/src/main/java/com/doumee/biz/system/impl/SystemDictDataBizImpl.java | 26 +++++++++-----------------
1 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/server/service/src/main/java/com/doumee/biz/system/impl/SystemDictDataBizImpl.java b/server/service/src/main/java/com/doumee/biz/system/impl/SystemDictDataBizImpl.java
index 20de185..5238700 100644
--- a/server/service/src/main/java/com/doumee/biz/system/impl/SystemDictDataBizImpl.java
+++ b/server/service/src/main/java/com/doumee/biz/system/impl/SystemDictDataBizImpl.java
@@ -15,6 +15,7 @@
import com.doumee.service.system.SystemDictService;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.mgt.DefaultSecurityManager;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -189,29 +190,20 @@
updWxMiniTokenDo(Constants.WX_APPID_PERSONNEL,Constants.WX_SECRET_PERSONNEL,Constants.WX_TOKEN_PERSONNEL);
}
- public void updWxMiniTokenDo(String appID,String appKey,String token) {
- String appId = queryByCode(Constants.WX_MINI_CONFIG,appID).getCode();
- String appSecret = queryByCode(Constants.WX_MINI_CONFIG,appKey).getCode();
+ public void updWxMiniTokenDo(String appIdKey,String secretKey,String tokenKey) {
+ DefaultSecurityManager securityManager = new DefaultSecurityManager();
+ SecurityUtils.setSecurityManager(securityManager);
+
+ String appId = queryByCode(Constants.WX_MINI_CONFIG,appIdKey).getCode();
+ String appSecret = queryByCode(Constants.WX_MINI_CONFIG,secretKey).getCode();
+ SystemDictData systemDictData = this.queryByCode(Constants.WX_MINI_CONFIG,tokenKey);
//鐢熸垚寰俊token
String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+appId+"&secret="+appSecret;
String response = HttpsUtil.sendGet(url);
JSONObject json = JSONObject.parseObject(response);
- SystemDictData systemDictData = queryByCode(Constants.WX_MINI_CONFIG,token);
systemDictData.setCode(json.getString("access_token"));
systemDictData.setUpdateTime(new Date());
- updateByIdNew(systemDictData);
-
- appId = queryByCode(Constants.WX_MINI_CONFIG,Constants.WX_APPID_PERSONNEL).getCode();
- appSecret = queryByCode(Constants.WX_MINI_CONFIG,Constants.WX_APPID_PERSONNEL).getCode();
- //鐢熸垚寰俊token
- url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+appId+"&secret="+appSecret;
- response = HttpsUtil.sendGet(url);
- json = JSONObject.parseObject(response);
- systemDictData = queryByCode(Constants.WX_MINI_CONFIG,Constants.WX_TOKEN_PERSONNEL);
- systemDictData.setCode(json.getString("access_token"));
- systemDictData.setUpdateTime(new Date());
- updateByIdNew(systemDictData);
-
+ systemDictDataService.updateById(systemDictData);
}
--
Gitblit v1.9.3