fix ali bug
This commit is contained in:
parent
a5f74659e6
commit
206ecd6712
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in New Issue