Don't need authorization when get file list

This commit is contained in:
FongMi 2023-06-26 18:26:02 +08:00
parent 149913463f
commit 0f247fac4e
4 changed files with 6 additions and 2 deletions

View File

@ -118,9 +118,9 @@ public class API {
private HashMap<String, String> getHeaderAuth() { private HashMap<String, String> getHeaderAuth() {
HashMap<String, String> headers = getHeader(); HashMap<String, String> headers = getHeader();
headers.put("authorization", user.getAuthorization());
headers.put("x-share-token", shareToken); headers.put("x-share-token", shareToken);
headers.put("X-Canary", "client=Android,app=adrive,version=v4.3.1"); headers.put("X-Canary", "client=Android,app=adrive,version=v4.3.1");
if (user.isAuthed()) headers.put("authorization", user.getAuthorization());
return headers; return headers;
} }

View File

@ -53,6 +53,10 @@ public class User {
return getTokenType() + " " + getAccessToken(); return getTokenType() + " " + getAccessToken();
} }
public boolean isAuthed() {
return getTokenType().length() > 0 && getAccessToken().length() > 0;
}
public User clean() { public User clean() {
this.refreshToken = ""; this.refreshToken = "";
this.accessToken = ""; this.accessToken = "";

Binary file not shown.

View File

@ -1 +1 @@
7398eb8460de8e8da9e898f465524414 493c8d428897bd6133ffd22eb1cb0495