binarywang / weixin-java-miniapp-demo

基于Spring Boot 和 WxJava 实现的微信小程序Java后端Demo
1.34k stars 679 forks source link

调用wxService.getUserService().getPhoneNoInfo(session.getSessionKey(), encryptedData, iv); #80

Open UFO233 opened 2 weeks ago

UFO233 commented 2 weeks ago
          调用wxService.getUserService().getPhoneNoInfo(session.getSessionKey(), encryptedData, iv);

出现如下报错:再授权一次就好了 java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

Originally posted by @Mr2017666 in https://github.com/binarywang/weixin-java-miniapp-demo/issues/27#issuecomment-633410069

UFO233 commented 1 week ago

我用的是4.6.5.B也是出现这种,第一次解密手机号出现 Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

Mr2017666 commented 1 week ago

解密手机号出现这种情况不要恐慌,属于正常情况,让前端加入重试逻辑,再调用一次解密就好了 Are you ok?