fix ali bug

This commit is contained in:
唐三 2023-01-08 17:41:57 +08:00
parent a5f74659e6
commit 206ecd6712
1 changed files with 2 additions and 1 deletions

View File

@ -90,6 +90,7 @@ public class Ali {
private boolean check401(String result) {
if (result.contains("AccessTokenInvalid")) return refreshAccessToken();
if (result.contains("ShareLinkTokenInvalid")) return refreshShareToken();
if (result.contains("InvalidParameterNotMatch")) return refreshShareToken();
return false;
}
@ -184,7 +185,7 @@ public class Ali {
try {
JSONObject body = new JSONObject();
String token = auth.getRefreshToken();
if (token.startsWith("http")) token = OkHttp.string(token);
if (token.startsWith("http")) token = OkHttp.string(token).replaceAll("[^A-Za-z0-9]", "");
body.put("refresh_token", token);
body.put("grant_type", "refresh_token");
JSONObject object = new JSONObject(post("https://auth.aliyundrive.com/v2/account/token", body));