From 781570e2bfb18090833bf91aa3a07dfb2d830c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=89=9B=E5=8F=89=E9=97=AA=E9=97=AA?= <18322780655@163.com> Date: Fri, 6 Sep 2024 11:09:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/util/WxAccountUtil.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/WxAccountUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/WxAccountUtil.java index 08a0a11..461531e 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/util/WxAccountUtil.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/WxAccountUtil.java @@ -23,11 +23,11 @@ import java.util.Map; @Component public class WxAccountUtil { @Value("${wx.ysk.appId}") - private static String appId = "wx212769170d2c6b2a"; + private String appId = "wx212769170d2c6b2a"; @Value("${wx.ysk.secrete}") - private static String secrete = "8492a7e8d55bbb1b57f5c8276ea1add0"; + private String secrete = "8492a7e8d55bbb1b57f5c8276ea1add0"; @Value("${wx.ysk.warnMsgTmpId}") - private static String msgTmpId = "C08OUr80x6wGmUN1zpFhSQ3Sv7VF5vksdZigiEx2pD0"; + private String msgTmpId = "C08OUr80x6wGmUN1zpFhSQ3Sv7VF5vksdZigiEx2pD0"; private final TbShopMsgStateMapper shopMsgStateMapper; static LinkedHashMap linkedHashMap=new LinkedHashMap<>(); @@ -49,7 +49,7 @@ public class WxAccountUtil { // sendStockWarnMsg("13213", "31123", "234", "ojC-S6n2DDlpj52iVMoiLL0Ry4HI"); } - public static String getRadarQrCode(Integer shopId) { + public String getRadarQrCode(Integer shopId) { HashMap req = new HashMap<>(); req.put("expire_seconds", 300); req.put("action_name", "QR_STR_SCENE"); @@ -70,7 +70,7 @@ public class WxAccountUtil { } - public static String getAccessToken() { + public String getAccessToken() { String resp = HttpUtil.get(StrUtil.format("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={}&secret={}", appId, secrete)); JSONObject respInfo = JSONObject.parseObject(resp); if (!respInfo.containsKey("access_token")) { @@ -80,7 +80,7 @@ public class WxAccountUtil { return respInfo.getString("access_token"); } - public static JSONObject sendTemplateMsg(String templateId, String toUserOpenId, Map data) { + public JSONObject sendTemplateMsg(String templateId, String toUserOpenId, Map data) { log.info("开始发送微信模板消息, 接收用户openId: {}, 消息数据: {}", toUserOpenId, data); String accessToken = getAccessToken();