This commit is contained in:
dukun 2023-02-02 13:47:19 +08:00
parent 7ebadc7b9a
commit a02949700f
1 changed files with 8 additions and 9 deletions

View File

@ -183,15 +183,14 @@ public class Ali {
private boolean refreshAccessToken() { private boolean refreshAccessToken() {
try { try {
getQRCode(); JSONObject body = new JSONObject();
// JSONObject body = new JSONObject(); String token = auth.getRefreshToken();
// String token = auth.getRefreshToken(); if (token.startsWith("http")) token = OkHttp.string(token).replaceAll("[^A-Za-z0-9]", "");
// if (token.startsWith("http")) token = OkHttp.string(token).replaceAll("[^A-Za-z0-9]", ""); body.put("refresh_token", token);
// body.put("refresh_token", token); body.put("grant_type", "refresh_token");
// body.put("grant_type", "refresh_token"); JSONObject object = new JSONObject(post("https://auth.aliyundrive.com/v2/account/token", body));
// JSONObject object = new JSONObject(post("https://auth.aliyundrive.com/v2/account/token", body)); auth.setAccessToken(object.getString("token_type") + " " + object.getString("access_token"));
// auth.setAccessToken(object.getString("token_type") + " " + object.getString("access_token")); auth.setRefreshToken(object.getString("refresh_token"));
// auth.setRefreshToken(object.getString("refresh_token"));
return true; return true;
} catch (Exception e) { } catch (Exception e) {
checkService(); checkService();