ソースを参照

解决微信报错问题

吴学文 6 年 前
親
コミット
7c6220fd08
共有1 個のファイルを変更した、2 個の追加 と 1 個の削除を含む
  1. 2 1
      AppFrontService/src/main/java/com/java110/app/smo/wxLogin/impl/WxLoginSMOImpl.java

+ 2 - 1
AppFrontService/src/main/java/com/java110/app/smo/wxLogin/impl/WxLoginSMOImpl.java

@@ -57,13 +57,14 @@ public class WxLoginSMOImpl extends AbstractComponentSMO implements IWxLoginSMO
         logger.debug("doLogin入参:" + paramIn.toJSONString());
         logger.debug("doLogin入参:" + paramIn.toJSONString());
         ResponseEntity<String> responseEntity;
         ResponseEntity<String> responseEntity;
         String code = paramIn.getString("code");
         String code = paramIn.getString("code");
-        String urlString = "?appid={appid}&secret={srcret}&js_code={code}&grant_type={grantType}";
+        String urlString = "?appid={appId}&secret={secret}&js_code={code}&grant_type={grantType}";
         String response = restTemplate.getForObject(
         String response = restTemplate.getForObject(
                 wechatAuthProperties.getSessionHost() + urlString, String.class,
                 wechatAuthProperties.getSessionHost() + urlString, String.class,
                 wechatAuthProperties.getAppId(),
                 wechatAuthProperties.getAppId(),
                 wechatAuthProperties.getSecret(),
                 wechatAuthProperties.getSecret(),
                 code,
                 code,
                 wechatAuthProperties.getGrantType());
                 wechatAuthProperties.getGrantType());
+
         logger.debug("微信返回报文:" + response);
         logger.debug("微信返回报文:" + response);
 
 
         Assert.jsonObjectHaveKey(response, "errcode", "返回报文中未包含 错误编码,接口出错");
         Assert.jsonObjectHaveKey(response, "errcode", "返回报文中未包含 错误编码,接口出错");