Fix: requestServer onFail - add errorCode argument

This commit is contained in:
2018-07-13 11:09:17 +09:00
parent e857fa1674
commit ab8ebb9ca1
16 changed files with 48 additions and 207 deletions
+2 -2
View File
@@ -39,7 +39,7 @@
updateMaestroList(jsonData["maestroList"]);
},
(errorMessage) => {
(errorMessage, errorCode) => {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
@@ -104,7 +104,7 @@
$("#error_message").text("마에스트로 계정이 정상적으로 등록되었습니다.");
},
(errorMessage) => {
(errorMessage, errorCode) => {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
-135
View File
@@ -1,135 +0,0 @@
<style>
.player_free {
/*background-color: #ff0000;*/
padding: 20px;
}
.maestro_free {
/*background-color: #0000ff;*/
padding: 20px;
}
</style>
<script>
function loadMaestroTestAccountInfo() {
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/maestro/maestro_test_account.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send();
xhr.onload = function() {
if(xhr.readyState === 4 && xhr.status === 200) {
// console.log(xhr.responseText);
// console.log(xhr.responseText.length);
if(xhr.responseText.length === 0 || xhr.responseText === null) {
console.log("no data from server");
return;
}
let replyJSON = JSON.parse(xhr.responseText);
// console.log(replyJSON);
if(replyJSON === null) {
console.log("no data from server");
return;
}
if(replyJSON["ERROR"] !== undefined || replyJSON["RESULT"] === undefined) {
console.log(replyJSON["ERROR"]);
return;
}
if(replyJSON["RESULT"] === "fail") {
console.log(replyJSON["RESULT"]);
return;
}
let maestroID = replyJSON["maestroID"];
let playerID = replyJSON["playerID"];
let playerName = replyJSON["playerName"];
console.log("maestroID : " + maestroID);
console.log("playerID : " + playerID);
console.log("playerName : " + playerName);
sessionStorage.setItem("maestroID", maestroID);
sessionStorage.setItem("playerID", playerID);
sessionStorage.setItem("playerName", playerName);
}
}
}
function playFree() {
loadMaestroTestAccountInfo();
window.open("./../client/menu_app.html", "_blank");
}
function experienceMaestro() {
loadMaestroTestAccountInfo();
location.href = "./../maestro/main_menu.html";
}
</script>
<div class="container">
<div class="player_free">
<div class="col alignCenter">
<a id="player_free_play" class="btn btn-rouge width400" onClick="playFree()" >학생 연습 앱<br/>무료 체험</a>
</div>
<ul id="free_app_list">
<li>
마우스 클릭 연습
</li>
<li>
마우스 더블 클릭 연습
</li>
<li>
한글 키보드 연습
</li>
</ul>
</div>
<div class="maestro_free">
<div class="col alignCenter">
<a id="maestro_free_menu" class="btn btn-sea width400" onClick="experienceMaestro()" >마에스트로<br/>관리자 메뉴 체험</a>
</div>
<ul id="maestro_preview">
<li>
플레이어 관리
</li>
<li>
과목 관리
</li>
<li>
랭킹
</li>
<li>
기록
</li>
</ul>
<div class="col alignCenter">
<a href="./../maestro/register.html" id="maestro_register" class="btn btn-sea width400">마에스트로<br/>가입</a>
</div>
<ul id="register_tip">
<li>
학생 20명 (1만원 / 1년)
</li>
<li>
학생 50명 (2만원 / 1년)
</li>
<li>
학생 100명 (3만원 / 1년)
</li>
</ul>
</div>
</div>
+1 -1
View File
@@ -33,7 +33,7 @@
location.href = 'admin_register_list.html';
},
(errorMessage) => {
(errorMessage, errorCode) => {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}