|
@@ -68,6 +68,7 @@ watch(status, () => {
|
|
|
email: false,
|
|
email: false,
|
|
|
code: false
|
|
code: false
|
|
|
}
|
|
}
|
|
|
|
|
+ isRememerPwd.value = false
|
|
|
verificationCode.value = ''
|
|
verificationCode.value = ''
|
|
|
getCode()
|
|
getCode()
|
|
|
})
|
|
})
|
|
@@ -166,10 +167,7 @@ const handleLogin = () => {
|
|
|
loginError.value.code = true
|
|
loginError.value.code = true
|
|
|
} else if (data.msg === 'error_times') {
|
|
} else if (data.msg === 'error_times') {
|
|
|
errorTipsRef.value.openDialog()
|
|
errorTipsRef.value.openDialog()
|
|
|
- }
|
|
|
|
|
- } else if (res.code === 500) {
|
|
|
|
|
- const { data } = res
|
|
|
|
|
- if (data.msg === 'passwordExpires') {
|
|
|
|
|
|
|
+ } else if (data.msg === 'passwordExpires') {
|
|
|
ElMessageBox.alert('Password expired, please change your password', 'Prompt', {
|
|
ElMessageBox.alert('Password expired, please change your password', 'Prompt', {
|
|
|
confirmButtonText: 'OK',
|
|
confirmButtonText: 'OK',
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
@@ -179,12 +177,6 @@ const handleLogin = () => {
|
|
|
router.push({
|
|
router.push({
|
|
|
name: 'Reset Password'
|
|
name: 'Reset Password'
|
|
|
})
|
|
})
|
|
|
- } else {
|
|
|
|
|
- ElMessageBox.alert(data.desc, {
|
|
|
|
|
- confirmButtonText: 'OK',
|
|
|
|
|
- type: 'warning',
|
|
|
|
|
- confirmButtonClass: 'el-button--dark'
|
|
|
|
|
- })
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -193,6 +185,21 @@ const handleLogin = () => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 从忘记密码返回登录
|
|
|
|
|
+const backLogin = (emailTips: boolean) => {
|
|
|
|
|
+ status.value = 'login'
|
|
|
|
|
+ isEmailTips.value = emailTips
|
|
|
|
|
+ // 如果是成功忘记密码,清空保存的账号密码
|
|
|
|
|
+ // 如果是直接返回登录,获取保存的账号密码
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ if (emailTips) {
|
|
|
|
|
+ clearCredentials()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ getCredentials()
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 0)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const isUserNameExit = ref(false)
|
|
const isUserNameExit = ref(false)
|
|
|
|
|
|
|
|
const handleForgot = () => {
|
|
const handleForgot = () => {
|
|
@@ -205,11 +212,12 @@ const handleSendPassword = () => {
|
|
|
$api
|
|
$api
|
|
|
.forgotPassword({
|
|
.forgotPassword({
|
|
|
login: loginForm.value.username,
|
|
login: loginForm.value.username,
|
|
|
- email: loginForm.value.email
|
|
|
|
|
|
|
+ email: loginForm.value.email,
|
|
|
|
|
+ verifcation_code: loginForm.value.code
|
|
|
})
|
|
})
|
|
|
.then((res: any) => {
|
|
.then((res: any) => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
- isEmailTips.value = true
|
|
|
|
|
|
|
+ backLogin(true)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -375,7 +383,7 @@ const errorTipsRef = ref()
|
|
|
<el-button @click="handleSendPassword" class="el-button--dark login-btn"
|
|
<el-button @click="handleSendPassword" class="el-button--dark login-btn"
|
|
|
>Send Password</el-button
|
|
>Send Password</el-button
|
|
|
>
|
|
>
|
|
|
- <div @click="status = 'login'" class="back-text">
|
|
|
|
|
|
|
+ <div @click="backLogin(false)" class="back-text">
|
|
|
<span class="font_family icon-icon_back_b"></span>
|
|
<span class="font_family icon-icon_back_b"></span>
|
|
|
<span class="text"> Back to login</span>
|
|
<span class="text"> Back to login</span>
|
|
|
</div>
|
|
</div>
|