fix export&import with no localstorage

pull/458/head
qkqpttgf 2021-10-22 13:36:26 +08:00 committed by GitHub
parent 330ec7680d
commit 621aadecdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -1790,7 +1790,6 @@ output:
</table><br> </table><br>
<table> <table>
<form id="config_f" name="config" action="" method="POST" onsubmit="return false;"> <form id="config_f" name="config" action="" method="POST" onsubmit="return false;">
<input name="_admin" type="hidden" value="">
<tr> <tr>
<td>' . getconstStr('AdminPassword') . ':<input type="password" name="pass"> <td>' . getconstStr('AdminPassword') . ':<input type="password" name="pass">
<button name="config_b" value="export" onclick="exportConfig(this);">' . getconstStr('export') . '</button></td> <button name="config_b" value="export" onclick="exportConfig(this);">' . getconstStr('export') . '</button></td>
@ -1833,7 +1832,7 @@ output:
xhr.onerror = function(e){ xhr.onerror = function(e){
alert("Network Error "+xhr.status); alert("Network Error "+xhr.status);
} }
xhr.send("pass=" + sha1(config_f.pass.value + "" + timestamp) + "&config_b=" + b.value + "&timestamp=" + timestamp); xhr.send("pass=" + sha1(config_f.pass.value + "" + timestamp) + "&config_b=" + b.value + "&timestamp=" + timestamp + "&_admin=" + localStorage.getItem("admin"));
} }
function importConfig(b) { function importConfig(b) {
if (config_f.pass.value=="") { if (config_f.pass.value=="") {
@ -1873,7 +1872,7 @@ output:
xhr.onerror = function(e){ xhr.onerror = function(e){
alert("Network Error "+xhr.status); alert("Network Error "+xhr.status);
} }
xhr.send("pass=" + sha1(config_f.pass.value + "" + timestamp) + "&config_t=" + encodeURIComponent(config_f.config_t.value) + "&config_b=" + b.value + "&timestamp=" + timestamp); xhr.send("pass=" + sha1(config_f.pass.value + "" + timestamp) + "&config_t=" + encodeURIComponent(config_f.config_t.value) + "&config_b=" + b.value + "&timestamp=" + timestamp + "&_admin=" + localStorage.getItem("admin"));
} }
function changePassword(f) { function changePassword(f) {
if (f.oldPass.value==""||f.newPass1.value==""||f.newPass2.value=="") { if (f.oldPass.value==""||f.newPass1.value==""||f.newPass2.value=="") {