1
0
mirror of synced 2025-12-29 03:17:56 +08:00

Merge pull request #14 from xkcoding/refactor-v1.6.0-beta

🏗️ 架构调整,简化代码
This commit is contained in:
yadong.zhang
2019-06-20 10:24:07 +08:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -24,7 +24,8 @@ public class AuthBaiduRequest extends BaseAuthRequest {
@Override
protected AuthToken getAccessToken(String code) {
String accessTokenUrl = UrlBuilder.getBaiduAccessTokenUrl(config.getClientId(), config.getClientSecret(), code, config.getRedirectUri());
String accessTokenUrl = UrlBuilder.getBaiduAccessTokenUrl(config.getClientId(), config.getClientSecret(), code, config
.getRedirectUri());
HttpResponse response = HttpRequest.post(accessTokenUrl).execute();
JSONObject accessTokenObject = JSONObject.parseObject(response.body());
AuthBaiduErrorCode errorCode = AuthBaiduErrorCode.getErrorCode(accessTokenObject.getString("error"));

View File

@@ -62,7 +62,8 @@ public class AuthWeiboRequest extends BaseAuthRequest {
.uuid(object.getString("id"))
.username(object.getString("name"))
.avatar(object.getString("profile_image_url"))
.blog(StringUtils.isEmpty(object.getString("url")) ? "https://weibo.com/" + object.getString("profile_url") : object.getString("url"))
.blog(StringUtils.isEmpty(object.getString("url")) ? "https://weibo.com/" + object.getString("profile_url") : object
.getString("url"))
.nickname(object.getString("screen_name"))
.location(object.getString("location"))
.remark(object.getString("description"))