Fix: loadMaestroID, saveMaestroID

This commit is contained in:
2018-07-06 08:41:47 +09:00
parent a9ccd52ba1
commit 49fd613dfc
13 changed files with 62 additions and 128 deletions
+37
View File
@@ -0,0 +1,37 @@
let maestroID = -1;
$(document).ready(function() {
loadMaestroID();
});
function loadMaestroID() {
maestroID = sessionStorage.getItem("maestroID");
if(maestroID === null) {
maestroID = -1;
sessionStorage.setItem("maestroID", maestroID);
}
maestroID = Number(maestroID);
console.log("loaded maestroID : " + maestroID);
}
function saveMaestroID() {
sessionStorage.setItem("maestroID", maestroID);
console.log("saved maestroID : " + maestroID);
}
function goHome() {
if(maestroID === -1) {
location.href = "./../main/index.html";
} else {
location.href = "./../maestro/main_menu.html";
}
}
function logout() {
sessionStorage.clear();
maestroID = -1;
sessionStorage.setItem("maestroID", maestroID);
location.href = './../main/index.html';
}