liujie
2026-04-19 e2b08a29091627edd251220216b6ac2ad8d9079b
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/WeChatUtil.java
@@ -23,11 +23,9 @@
@Component
public class WeChatUtil {
    @Value("${wx.appletsAppid}")
    private String wxAppletsAppid;
    private String wxAppletsAppid="wx20301e30167d920e";
    @Value("${wx.appletsAppSecret}")
    private String wxAppletsAppSecret;
    private String wxAppletsAppSecret="4b8fe5cea20c4309fa996caa06ac9b4c";
    @Autowired
    private RestTemplate restTemplate;
@@ -39,7 +37,7 @@
     * @return
     */
    public Map<String, String> code2Session(String jscode){
        String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxAppletsAppid + "&secret=" + wxAppletsAppSecret
        String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + "wx20301e30167d920e" + "&secret=" + "4b8fe5cea20c4309fa996caa06ac9b4c"
                + "&js_code=" + jscode + "&grant_type=authorization_code";
        String forObject = restTemplate.getForObject(url, String.class);
        JSONObject jsonObject = JSON.parseObject(forObject);
@@ -85,7 +83,7 @@
        String content = "jsapi_ticket=" + ticket + "&noncestr=" + noncestr + "&timestamp=" + timestamp + "&url=" + url;
        String signature = DigestUtils.sha1Hex(content);
        Map<String,Object> map=new HashMap<>();
        map.put("appId", wxAppletsAppid);
        map.put("appId", "wx20301e30167d920e");
        map.put("timestamp", timestamp);
        map.put("nonceStr", noncestr);
        map.put("signature", signature);