Add: maestro test account, player for experience mode

This commit is contained in:
2018-07-08 22:46:39 +09:00
parent 785575a1e1
commit b34e62c4ea
6 changed files with 337 additions and 8 deletions
+54 -4
View File
@@ -14,10 +14,60 @@
<script>
function experienceMaestro() {
maestroID = 0;
sessionStorage.setItem("maestroID", maestroID);
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";
}
@@ -28,7 +78,7 @@ function experienceMaestro() {
<div class="container">
<div class="player_free">
<div class="col alignCenter">
<a href="./../client/menu_app.html" target="_blank" id="player_free_play" class="btn btn-rouge width400">학생 연습 앱<br/>무료 체험</a>
<a id="player_free_play" class="btn btn-rouge width400" onClick="playFree()" >학생 연습 앱<br/>무료 체험</a>
</div>
<ul id="free_app_list">