From acb5aa8f5eccc8385ba399069495faf545da731a Mon Sep 17 00:00:00 2001 From: whes1015 Date: Fri, 29 Mar 2024 02:33:05 +0800 Subject: [PATCH] fix: params --- src/scripts/change.js | 4 ++-- src/scripts/login.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/change.js b/src/scripts/change.js index 4175da7..15a6397 100644 --- a/src/scripts/change.js +++ b/src/scripts/change.js @@ -44,7 +44,7 @@ new_password.oninput = (e) => { const urlSearchParams = new URLSearchParams(window.location.search); const params = Object.fromEntries(urlSearchParams.entries()); -if (!params.token) +if (!params.key) document.location.replace("./login.html"); submit.addEventListener("click", (e) => { @@ -67,7 +67,7 @@ submit.addEventListener("click", (e) => { method : "POST", headers : { "Content-Type": "application/json" }, body : JSON.stringify({ - token : params.token, + key : params.key, new_pass : new_password.value, }), }) diff --git a/src/scripts/login.js b/src/scripts/login.js index fe44356..f59871f 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?token=${await res.text()}`; + window.location.href = `./user.html?key=${await res.text()}`; } else { switch (await res.text()) { case "Invaild email!": {