Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调用小程序解密用户手机号接口,Gson解析偶尔出现异常 #1666

Closed
xuxinlong001 opened this issue Jul 13, 2020 · 2 comments
Closed

Comments

@xuxinlong001
Copy link

简要描述

调用小程序解密用户手机号接口,Gson偶尔出现异常

模块版本情况

  • WxJava 模块名: wx-java-miniapp-spring-boot-starter
  • WxJava 版本号: 3.8.0其他版本也同样有这个问题

详细描述

接口:wxMaService.getUserService().getPhoneNoInfo()
第一次授权手机号时总会异常,第二次就好了,打断点发现报错是解析时会出现乱码导致的

日志

2020-07-13 17:13:56,351 [http-nio-8080-exec-3] ERROR c.p.c.e.GlobalExceptionHandler 112 - 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 $
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226)
at com.google.gson.Gson.fromJson(Gson.java:932)
at com.google.gson.Gson.fromJson(Gson.java:897)
at com.google.gson.Gson.fromJson(Gson.java:846)
at com.google.gson.Gson.fromJson(Gson.java:817)
at cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo.fromJson(WxMaPhoneNumberInfo.java:23)
at cn.binarywang.wx.miniapp.api.impl.WxMaUserServiceImpl.getPhoneNoInfo(WxMaUserServiceImpl.java:56)

@binarywang
Copy link
Owner

请参考置顶区的问题,不要重复提问题

@binarywang
Copy link
Owner

#359

Repository owner locked as resolved and limited conversation to collaborators Jul 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants