Bladeren bron

小程序微信登录调试

黄远 5 jaren geleden
bovenliggende
commit
8755164a31

+ 1 - 1
lift-system-service/src/main/java/cn/com/ty/lift/system/wechat/constants/WxConstants.java

@@ -49,7 +49,7 @@ public class WxConstants {
         /**
          * 小程序secret
          */
-        String APP_SECRET = "f93a555feaa7d1af007d128d5a3dd861";
+        String APP_SECRET = "c5b986baad1ac89372de2595fb83b999";
     }
 
 }

+ 3 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/wechat/utils/WxUtil.java

@@ -4,12 +4,14 @@ import cn.com.ty.lift.system.wechat.constants.WxConstants;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
+import lombok.extern.slf4j.Slf4j;
 
 /**
  * @author huangyuan
  * @date 2019-12-30
  * @description
  */
+@Slf4j
 public class WxUtil {
 
     /**
@@ -48,6 +50,7 @@ public class WxUtil {
                 .replace("SECRET", appSecret)
                 .replace("CODE", authCode);
         JSONObject result = JSONUtil.parseObj(HttpUtil.get(url));
+        log.error(result.toString());
         if (result.containsKey("openid")) {
             return result.getStr("openid");
         }