try fix: add Aliyundrive will instead current disk

pull/217/head
qkqpttgf 2021-01-24 16:51:33 +08:00 committed by GitHub
parent bdedf7a4b0
commit 0b6adc077c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -604,8 +604,7 @@ class Aliyundrive {
document.cookie=\'disktag=; path=/; \'+expires;
</script>', 'Error', 201);
}
$tmp['refresh_token'] = $_POST['refresh_token'];
$res = curl('POST', $this->auth_url, json_encode($tmp), ["content-type"=>"application/json; charset=utf-8"]);
$res = curl('POST', $this->auth_url, json_encode([ 'refresh_token' => $_POST['refresh_token'] ]), ["content-type"=>"application/json; charset=utf-8"]);
//return output($res['body']);
if ($res['stat']!=200) {
return message($res['body'], $res['stat'], $res['stat']);
@ -623,6 +622,7 @@ class Aliyundrive {
$tmp['Driver'] = 'Aliyundrive';
$tmp['disktag_add'] = $_POST['disktag_add'];
$tmp['diskname'] = $_POST['diskname'];
//error_log(json_encode($tmp));
$response = setConfigResponse( setConfig($tmp, $this->disktag) );
if (api_error($response)) {
@ -684,11 +684,11 @@ class Aliyundrive {
return false;
}
document.getElementById("form1").action="?install0&AddDisk=Aliyundrive";
var expd = new Date();
expd.setTime(expd.getTime()+(2*60*60*1000));
var expires = "expires="+expd.toGMTString();
document.cookie=\'disktag=\'+t.disktag_add.value+\'; path=/; \'+expires;
document.getElementById("form1").action="?install0&disktag=" + t.disktag_add.value + "&AddDisk=Aliyundrive";
//var expd = new Date();
//expd.setTime(expd.getTime()+(2*60*60*1000));
//var expires = "expires="+expd.toGMTString();
//document.cookie=\'disktag=\'+t.disktag_add.value+\'; path=/; \'+expires;
return true;
}
</script>';