diff --git a/SrcJyAliPublic.js b/SrcJyAliPublic.js index 109ea69..3eccc2e 100644 --- a/SrcJyAliPublic.js +++ b/SrcJyAliPublic.js @@ -384,22 +384,21 @@ function getOpenToken(authorization) { "height": 500, }), }); - log(res); + let data = JSON.parse(res).data; let sid = data["sid"]; - let body = { - "authorize": 1, - "scope": "user:base,file:all:read,file:all:write", - "drives": ["backup", "resource"], - "scopes": ["user:base", "file:all:read", "file:all:write"], - "sid": sid + function get_qrcode_code(sid) { + let res = fetch("https://openapi.aliyundrive.com/oauth/qrcode/" + sid + "/status"); + return JSON.parse(res).authCode; } + log(get_qrcode_code(sid)); + let json = JSON.parse(request('http://api.extscreen.com/aliyundrive/token', { - headers: headers, - body: body, + body: get_qrcode_code(sid), method: 'POST', timeout: 8000 })); + log(json); return json; //let code = json.redirectUri.split("code=")[1];