|
|
|
@ -332,9 +332,7 @@ function getOpenToken(authorization) { |
|
|
|
|
refresh_token: refresh_token |
|
|
|
|
} |
|
|
|
|
variable = 1; |
|
|
|
|
log('1111'); |
|
|
|
|
} else { |
|
|
|
|
log('2222'); |
|
|
|
|
let json = JSON.parse(request('https://open.aliyundrive.com/oauth/users/authorize?client_id=76917ccccd4441c39457a04f6084fb2f&redirect_uri=https://alist.nn.ci/tool/aliyundrive/callback&scope=user:base,file:all:read,file:all:write&state=Ojo=&response_type=code', { |
|
|
|
|
headers: headers, |
|
|
|
|
body: { |
|
|
|
@ -346,23 +344,16 @@ function getOpenToken(authorization) { |
|
|
|
|
method: 'POST', |
|
|
|
|
timeout: 8000 |
|
|
|
|
})); |
|
|
|
|
log(json); |
|
|
|
|
let code = json.redirectUri.split("code=")[1].split("&state")[0]; |
|
|
|
|
data = { "code": code, "grant_type": "authorization_code" } |
|
|
|
|
log(data); |
|
|
|
|
variable = 0; |
|
|
|
|
} |
|
|
|
|
let json2 = {}; |
|
|
|
|
//try {
|
|
|
|
|
// json2 = JSON.parse(request('https://api.xhofe.top/alist/ali_open/token', { body: data, method: 'POST', timeout: 8000 }));
|
|
|
|
|
// log("https://api.xhofe.top/alist/ali_open/token");
|
|
|
|
|
// log(json2);
|
|
|
|
|
//} catch (e) {
|
|
|
|
|
try { |
|
|
|
|
json2 = JSON.parse(request('https://api-cf.nn.ci/alist/ali_open/token', { body: data, method: 'POST', timeout: 8000 })); |
|
|
|
|
log("https://api-cf.nn.ci/alist/ali_open/token"); |
|
|
|
|
log(json2); |
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
json2 = JSON.parse(request('https://api.xhofe.top/alist/ali_open/token', { body: data, method: 'POST', timeout: 8000 })); |
|
|
|
|
} |
|
|
|
|
json2.variable = variable; |
|
|
|
|
return json2; |
|
|
|
|
} |
|
|
|
|