diff --git a/ede.js b/ede.js index a29da92..74a5e50 100644 --- a/ede.js +++ b/ede.js @@ -298,15 +298,16 @@ const account = document.getElementById('ddPlayAccount').value; const password = document.getElementById('ddPlayPassword').value; if (account && password) { - const status = loginDanDanPlay(account, password); - if (status) { - document.getElementById('loginBtn').innerText = '登录✔️'; - let sleep = new Promise(resolve => setTimeout(resolve, 1500)); - sleep.then(() => { - document.getElementById('loginDialog').style.display = 'none'; - }); - modal.removeEventListener('keydown', event => event.stopPropagation(), true); - } + loginDanDanPlay(account, password).then(status => { + if (status) { + document.getElementById('loginBtn').innerText = '登录✔️'; + let sleep = new Promise(resolve => setTimeout(resolve, 1500)); + sleep.then(() => { + document.getElementById('loginDialog').style.display = 'none'; + }); + modal.removeEventListener('keydown', event => event.stopPropagation(), true); + } + }); } }; document.getElementById('cancelBtn').onclick = () => { @@ -323,7 +324,7 @@ modal.style.display = 'none'; modal.innerHTML = `