1
0
mirror of synced 2026-02-22 20:47:47 +08:00

🎨 解决Issue #IY2OH

This commit is contained in:
yadong.zhang
2019-06-18 19:27:11 +08:00
parent f32c341b63
commit c0dd700b0a
6 changed files with 16 additions and 4 deletions

View File

@@ -67,14 +67,17 @@ public class AuthAlipayRequest extends BaseAuthRequest {
if (!response.isSuccess()) {
throw new AuthException(response.getSubMsg());
}
String province = response.getProvince(),
city = response.getCity();
String location = String.format("%s %s", StringUtils.isEmpty(province) ? "" : province, StringUtils.isEmpty(city) ? "" : city);
return AuthUser.builder()
.uuid(response.getUserId())
.username(StringUtils.isEmpty(response.getUserName()) ? response.getNickName() : response.getUserName())
.nickname(response.getNickName())
.avatar(response.getAvatar())
.location(String.format("%s %s", StringUtils.isEmpty(province) ? "" : province, StringUtils.isEmpty(city) ? "" : city))
.location(location)
.gender(AuthUserGender.getRealGender(response.getGender()))
.token(authToken)
.source(AuthSource.ALIPAY)

View File

@@ -45,6 +45,7 @@ public class AuthCodingRequest extends BaseAuthRequest {
if (object.getIntValue("code") != 0) {
throw new AuthException(object.getString("msg"));
}
object = object.getJSONObject("data");
return AuthUser.builder()
.uuid(object.getString("id"))

View File

@@ -59,11 +59,13 @@ public class AuthQqRequest extends BaseAuthRequest {
if (StringUtils.isEmpty(avatar)) {
avatar = object.getString("figureurl_qq_1");
}
String location = String.format("%s-%s", object.getString("province"), object.getString("city"));
return AuthUser.builder()
.username(object.getString("nickname"))
.nickname(object.getString("nickname"))
.avatar(avatar)
.location(object.getString("province") + "-" + object.getString("city"))
.location(location)
.uuid(openId)
.gender(AuthUserGender.getRealGender(object.getString("gender")))
.token(authToken)

View File

@@ -42,11 +42,12 @@ public class AuthWeChatRequest extends BaseAuthRequest {
this.checkResponse(object);
String location = String.format("%s-%s-%s", object.getString("country"), object.getString("province"), object.getString("city"));
return AuthUser.builder()
.username(object.getString("nickname"))
.nickname(object.getString("nickname"))
.avatar(object.getString("headimgurl"))
.location(object.getString("country") + "-" + object.getString("province") + "-" + object.getString("city"))
.location(location)
.uuid(openId)
.gender(AuthUserGender.getRealGender(object.getString("sex")))
.token(authToken)
@@ -73,6 +74,7 @@ public class AuthWeChatRequest extends BaseAuthRequest {
throw new AuthException(object.getIntValue("errcode"), object.getString("errmsg"));
}
}
/**
* 获取token适用于获取access_token和刷新token
*