From e6320fdf90ba080e9e0919c2c925ce29d7c636c7 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Mon, 22 Jul 2024 20:44:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJyAliPublic.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJyAliPublic.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) 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];