diff --git a/src/scripts/login.js b/src/scripts/login.js index f59871f..46e9df8 100644 --- a/src/scripts/login.js +++ b/src/scripts/login.js @@ -39,7 +39,7 @@ submit.addEventListener("click", (e) => { }) .then(async res => { if (res.ok) { - window.location.href = `./user.html?key=${await res.text()}`; + window.location.href = `./user.html?key=${await res.text()}&email=${values.email}`; } else { switch (await res.text()) { case "Invaild email!": { diff --git a/src/scripts/user.js b/src/scripts/user.js index 8f45ea3..fd3a994 100644 --- a/src/scripts/user.js +++ b/src/scripts/user.js @@ -67,7 +67,7 @@ function Pay(type) { pay_1.style.display = "none"; pay_2.style.display = "none"; pay_3.style.display = "none"; - fetch(`${base_url}/api/v1/et/pay?type=${type}&key=${params.key}`) + fetch(`${base_url}/api/v3/et/pay?type=${type}&key=${params.key}`) .then(async res => { document.getElementById("pay-button").textContent = `NTD ${(type == 1) ? "100" : (type == 2) ? "500" : "1000"} 前往付款`; const data = await res.json(); @@ -102,7 +102,7 @@ const toTimeString = (timestamp) => { ].join(""); }; -fetch(`${base_url}/api/v1/et/service-info`) +fetch(`${base_url}/api/v3/et/service-info`) .then(async res => { const data = await res.json(); service_list = data.list; @@ -313,7 +313,7 @@ function ColorCode() { } const toggleService = (type, status) => { - fetch(`${base_url}/api/v1/et/${(!status) ? "subscribe" : "unsubscribe"}?key=${params.key}&type=${type}`) + fetch(`${base_url}/api/v3/et/${(!status) ? "subscribe" : "unsubscribe"}?key=${params.key}&type=${type}`) .then(res => { if (res.ok) refresh(); @@ -333,7 +333,7 @@ const copy = (key) => { }; const deleteKey = (key) => { - fetch(`${base_url}/api/v1/et/key-remove?key=${params.key}`) + fetch(`${base_url}/api/v3/et/key-remove?key=${params.key}`) .then(res => { if (res.ok) refresh(); @@ -500,7 +500,7 @@ function reload_service() { } create.onclick = () => { - fetch(`${base_url}/api/v1/et/key-add`, { + fetch(`${base_url}/api/v3/et/key-add`, { method : "POST", headers : { "Content-Type": "application/json" }, body : JSON.stringify({ @@ -523,7 +523,7 @@ document.getElementById("logout").addEventListener("click", function() { document.body.style.pointerEvents = "none"; this.disabled = true; this.classList.add("loading"); - fetch(`${base_url}/api/v1/et/logout?key=${params.key}`) + fetch(`${base_url}/api/v3/et/logout?key=${params.key}&email=${params.email}`) .then(res => { if (res.ok) window.location.replace("./login.html");