如果你在使用中遇到问题,请到
社区进行反馈
@@ -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 = ''