|
|
@@ -53,6 +53,16 @@ const handleTokenRedirect = () => {
|
|
|
})
|
|
|
.then((res: any) => {
|
|
|
handleResult(res)
|
|
|
+ if (res.code === 400) {
|
|
|
+ const { data } = res
|
|
|
+ if (data.msg === 'Invalid token') {
|
|
|
+ ElMessageBox.alert('Invalid token', 'Prompt', {
|
|
|
+ confirmButtonText: 'OK',
|
|
|
+ type: 'warning',
|
|
|
+ confirmButtonClass: 'el-button--dark'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
@@ -88,6 +98,8 @@ const saveCredentials = () => {
|
|
|
// 验证当前用户是否存在
|
|
|
const handleCheckUser = () => {
|
|
|
if (!loginForm.value.username) {
|
|
|
+ loginError.value.username = true
|
|
|
+ isUserNameExit.value = false
|
|
|
return
|
|
|
}
|
|
|
// 这里是验证用户是否存在的逻辑
|
|
|
@@ -221,13 +233,7 @@ const handleResult = (res: any) => {
|
|
|
router.push('/')
|
|
|
} else if (res.code === 400) {
|
|
|
const { data } = res
|
|
|
- if (data.msg === 'Invalid token') {
|
|
|
- ElMessageBox.alert('Invalid token', 'Prompt', {
|
|
|
- confirmButtonText: 'OK',
|
|
|
- type: 'warning',
|
|
|
- confirmButtonClass: 'el-button--dark'
|
|
|
- })
|
|
|
- } else if (data.msg === 'passwordExpires') {
|
|
|
+ if (data.msg === 'passwordExpires') {
|
|
|
ElMessageBox.alert('Please change your password for security.', 'Prompt', {
|
|
|
confirmButtonText: 'Change Password',
|
|
|
type: 'warning',
|
|
|
@@ -259,6 +265,13 @@ const handleLoginAfterVerify = () => {
|
|
|
} else {
|
|
|
clearCredentials()
|
|
|
}
|
|
|
+ } else if (res.code === 400) {
|
|
|
+ const { data } = res
|
|
|
+ if (data.msg === 'password_error') {
|
|
|
+ loginError.value.password = true
|
|
|
+ } else if (data.msg === 'error_times') {
|
|
|
+ errorTipsRef.value.openDialog()
|
|
|
+ }
|
|
|
}
|
|
|
handleResult(res)
|
|
|
})
|