From b077aaef9fe0e6269ff7ca0eb3299a3e19f6f8d2 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 9 Jul 2022 17:18:55 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=BF=80=E6=B4=BB=E7=A0=81=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E7=94=A8=E6=97=B6=E6=B8=85=E7=A9=BA=E8=BE=93=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/config/account.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/config/account.ts b/app/src/config/account.ts index 54484bbe9..19fda7298 100644 --- a/app/src/config/account.ts +++ b/app/src/config/account.ts @@ -219,7 +219,11 @@ ${window.siyuan.languages.account8}`; }); const activationCodeElement = account.element.querySelector("#activationCode"); activationCodeElement.addEventListener("click", () => { - fetchPost("/api/account/checkActivationcode", {data: (activationCodeElement.previousElementSibling as HTMLInputElement).value}, (response) => { + const activationCodeInput = (activationCodeElement.previousElementSibling as HTMLInputElement) + fetchPost("/api/account/checkActivationcode", {data: activationCodeInput.value}, (response) => { + if (0 !== response.code) { + activationCodeInput.value = ""; + } confirmDialog(window.siyuan.languages.activationCode, response.msg, () => { if (response.code === 0) { fetchPost("/api/account/useActivationcode", {data: (activationCodeElement.previousElementSibling as HTMLInputElement).value}, () => {