From 2cc14753ec4fa941d66d1e1060cfe0247f729c66 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Fri, 10 Mar 2023 21:13:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'ali=5Fecc.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ali_ecc.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ali_ecc.js b/ali_ecc.js index cd77199..9559416 100644 --- a/ali_ecc.js +++ b/ali_ecc.js @@ -26,15 +26,22 @@ function getAliUrl(share_id, file_id, alitoken) { storage0.putMyVar('aliuserinfo', userinfo); } let authorization = 'Bearer ' + userinfo.access_token; - let userId = userinfo.user_id; let deviceId = userinfo.device_id; - let getaliecc = JSON.parse(request('http://124.221.241.174:87/api', { body: 'did=' + deviceId + '&uid=' + userId + '&token=' + md5(getNowTime()), method: 'POST', timeout: 3000 })); + let userId = userinfo.user_id; let signature; let public_key; - if (getaliecc.code == 200) { - signature = getaliecc.sign; - public_key = getaliecc.key; + if(typeof(justTestSign)!="undefined"){ + let getaliecc = justTestSign('5dde4e1bdf9e4966b387ba58f4b3fdc3',deviceId,userId); + signature = getaliecc.split('##')[0]; + public_key = getaliecc.split('##')[1]; + }else{ + let getaliecc = JSON.parse(request('http://124.221.241.174:87/api', { body: 'did=' + deviceId + '&uid=' + userId + '&token=' + md5(getNowTime()), method: 'POST', timeout: 3000 })); + if (getaliecc.code == 200) { + signature = getaliecc.sign; + public_key = getaliecc.key; + } } + headers['authorization'] = authorization; headers['x-device-id'] = deviceId; headers['x-signature'] = signature;