1
0
mirror of synced 2026-05-22 21:53:18 +00:00

🔖 1.15.5-alpha

This commit is contained in:
yadong.zhang
2020-06-07 16:28:27 +08:00
parent 571c3438e4
commit e93ad07c5f
44 changed files with 453 additions and 214 deletions
@@ -1,7 +1,7 @@
package me.zhyd.oauth.request;
import com.alibaba.fastjson.JSONObject;
import com.xkcoding.http.HttpUtil;
import me.zhyd.oauth.utils.HttpUtils;
import com.xkcoding.http.constants.Constants;
import me.zhyd.oauth.cache.AuthStateCache;
import me.zhyd.oauth.config.AuthConfig;
@@ -41,7 +41,7 @@ public class AuthMiRequest extends AuthDefaultRequest {
}
private AuthToken getToken(String accessTokenUrl) {
String response = HttpUtil.get(accessTokenUrl);
String response = new HttpUtils(config.getHttpConfig()).get(accessTokenUrl);
String jsonStr = response.replace(PREFIX, Constants.EMPTY);
JSONObject accessTokenObject = JSONObject.parseObject(jsonStr);
@@ -88,7 +88,7 @@ public class AuthMiRequest extends AuthDefaultRequest {
String emailPhoneUrl = MessageFormat.format("{0}?clientId={1}&token={2}", "https://open.account.xiaomi.com/user/phoneAndEmail", config
.getClientId(), authToken.getAccessToken());
String emailResponse = HttpUtil.get(emailPhoneUrl);
String emailResponse = new HttpUtils(config.getHttpConfig()).get(emailPhoneUrl);
JSONObject userEmailPhone = JSONObject.parseObject(emailResponse);
if (!"error".equalsIgnoreCase(userEmailPhone.getString("result"))) {
JSONObject emailPhone = userEmailPhone.getJSONObject("data");