提交 11707e69 编写于 作者: 智布道's avatar 智布道 👁

🔥 微信公众平台支持返回快照数据

上级 3564c846
...@@ -44,6 +44,12 @@ public class AuthToken implements Serializable { ...@@ -44,6 +44,12 @@ public class AuthToken implements Serializable {
* @since 1.10.0 * @since 1.10.0
*/ */
private String code; private String code;
/**
* 微信公众号 - 网页授权的登录时可用
*
* 微信针对网页授权登录,增加了一个快照页的逻辑,快照页获取到的微信用户的 uid oid 和头像昵称都是虚拟的信息
*/
private boolean snapshotUser;
/** /**
* Twitter附带属性 * Twitter附带属性
......
...@@ -72,4 +72,11 @@ public class AuthUser implements Serializable { ...@@ -72,4 +72,11 @@ public class AuthUser implements Serializable {
*/ */
private JSONObject rawUserInfo; private JSONObject rawUserInfo;
/**
* 微信公众号 - 网页授权的登录时可用
*
* 微信针对网页授权登录,增加了一个快照页的逻辑,快照页获取到的微信用户的 uid oid 和头像昵称都是虚拟的信息
*/
private boolean snapshotUser;
} }
...@@ -65,6 +65,7 @@ public class AuthWeChatMpRequest extends AuthDefaultRequest { ...@@ -65,6 +65,7 @@ public class AuthWeChatMpRequest extends AuthDefaultRequest {
.avatar(object.getString("headimgurl")) .avatar(object.getString("headimgurl"))
.location(location) .location(location)
.uuid(openId) .uuid(openId)
.snapshotUser(authToken.isSnapshotUser())
.gender(AuthUserGender.getWechatRealGender(object.getString("sex"))) .gender(AuthUserGender.getWechatRealGender(object.getString("sex")))
.token(authToken) .token(authToken)
.source(source.toString()) .source(source.toString())
...@@ -108,6 +109,7 @@ public class AuthWeChatMpRequest extends AuthDefaultRequest { ...@@ -108,6 +109,7 @@ public class AuthWeChatMpRequest extends AuthDefaultRequest {
.expireIn(accessTokenObject.getIntValue("expires_in")) .expireIn(accessTokenObject.getIntValue("expires_in"))
.openId(accessTokenObject.getString("openid")) .openId(accessTokenObject.getString("openid"))
.scope(accessTokenObject.getString("scope")) .scope(accessTokenObject.getString("scope"))
.snapshotUser(accessTokenObject.getIntValue("is_snapshotuser") == 1)
.build(); .build();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册