Vanessa 2022-07-16 12:00:33 +08:00
parent ccd17df4cf
commit 724ab74566

View file

@ -148,7 +148,7 @@
<h1 style="margin-bottom: 48px;">思源 SiYuan</h1>
<input class="b3-text-filed" id="authCode" type="password" placeholder="授权码 Auth code"/><br>
<div style="position: relative;width: 240px;margin: 8px auto 0;display: none">
<img id="captchaImg" style="top: 1px;position: absolute;height: 28px;right: 1px;">
<img id="captchaImg" style="top: 1px;position: absolute;height: 28px;right: 1px;cursor: pointer">
<input id="captcha" class="b3-text-filed" placeholder="验证码 Captcha">
</div>
<button class="b3-button" onclick="submitAuth()">解锁 Unlock</button>
@ -457,6 +457,10 @@
}
})
captchaElement.previousElementSibling.addEventListener('click', function () {
this.src = '/api/system/getCaptcha'
})
const submitAuth = () => {
fetch('/api/system/loginAuth', {
method: 'POST',
@ -483,6 +487,7 @@
document.querySelector('#message').classList.add('b3-snackbar--show')
document.querySelector('#message').firstElementChild.textContent = response.msg
inputElement.value = ''
inputElement.focus()
setTimeout(() => {
document.querySelector('#message').classList.remove('b3-snackbar--show')
document.querySelector('#message').firstElementChild.textContent = ''