rm rewrite check

pull/500/merge
qkqpttgf 2021-12-24 09:13:32 +08:00 committed by GitHub
parent 544035b07a
commit d99ee1dadc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 27 deletions

View File

@ -202,13 +202,11 @@ function install()
$title = 'Error';
return message($html, $title, 201);
}*/
$html .= '<button id="checkrewritebtn" onclick="checkrewrite();">'.getconstStr('MakesuerRewriteOn').'</button>
<div id="formdiv" style="display: none">
$html .= '
<form action="?install2" method="post" onsubmit="return notnull(this);">
<input name="admin" type="password" placeholder="' . getconstStr('EnvironmentsDescription')['admin'] . '" size="' . strlen(getconstStr('EnvironmentsDescription')['admin']) . '"><br>
<input id="submitbtn" type="submit" value="'.getconstStr('Submit').'" disabled>
<input id="submitbtn" type="submit" value="'.getconstStr('Submit').'">
</form>
</div>
<script>
var nowtime= new Date();
var timezone = 0-nowtime.getTimezoneOffset()/60;
@ -224,29 +222,6 @@ function install()
}
return true;
}
function checkrewrite()
{
url=location.protocol + "//" + location.host;
//if (location.port!="") url += ":" + location.port;
url += location.pathname;
if (url.substr(-1)!="/") url += "/";
url += "app.json";
url += "?" + Date.now();
var xhr4 = new XMLHttpRequest();
xhr4.open("GET", url);
xhr4.setRequestHeader("x-requested-with","XMLHttpRequest");
xhr4.send(null);
xhr4.onload = function(e){
console.log(xhr4.responseText+","+xhr4.status);
if (xhr4.status==201) {
document.getElementById("checkrewritebtn").style.display = "none";
document.getElementById("submitbtn").disabled = false;
document.getElementById("formdiv").style.display = "";
} else {
alert("' . getconstStr('MakesuerRewriteOn') . '?\nfalse\n\nUrl: " + url + "\nExpect http code 201, but received " + xhr4.status);
}
}
}
</script>';
$title = getconstStr('SetAdminPassword');
return message($html, $title, 201);