diff --git a/app/stage/auth.html b/app/stage/auth.html index fba03eaad..493df8a00 100644 --- a/app/stage/auth.html +++ b/app/stage/auth.html @@ -64,7 +64,6 @@ } .b3-text-filed { - text-align: center; width: 240px; border: 1px solid #5f6368; border-radius: 4px; @@ -148,6 +147,10 @@

思源 SiYuan


+
+ + +
如果你在使用中遇到问题,请到社区进行反馈
@@ -446,6 +449,7 @@ } const inputElement = document.getElementById('authCode') + const captchaElement = document.getElementById('captcha') inputElement.focus() inputElement.addEventListener('keydown', (event) => { if (event.key === 'Enter') { @@ -456,7 +460,10 @@ const submitAuth = () => { fetch('/api/system/loginAuth', { method: 'POST', - body: JSON.stringify({'authCode': inputElement.value}), + body: JSON.stringify({ + authCode: inputElement.value, + captchaImg: captchaElement.value, + }), }).then((response) => { return response.json() }).then((response) => { @@ -465,6 +472,14 @@ return } + if (response.code === 1) { + captchaElement.previousElementSibling.src = '/api/system/getCaptcha' + captchaElement.parentElement.style.display = 'block' + } else { + captchaElement.parentElement.style.display = 'none' + captchaElement.previousElementSibling.src = '' + } + document.querySelector('#message').classList.add('b3-snackbar--show') document.querySelector('#message').firstElementChild.textContent = response.msg inputElement.value = ''