mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 12:28:48 +01:00
🎨 激活码不可用时清空输入
This commit is contained in:
parent
fdc95fcade
commit
b077aaef9f
1 changed files with 5 additions and 1 deletions
|
|
@ -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}, () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue