mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-21 22:53:56 +08:00
fix:完善重置密码页面多语言支持
This commit is contained in:
@@ -389,6 +389,7 @@ export default {
|
||||
// Retrieve password page text
|
||||
'retrievePassword.title': 'Reset Password',
|
||||
'retrievePassword.welcome': 'PASSWORD RETRIEVE',
|
||||
'retrievePassword.subtitle': 'Retrieve Password',
|
||||
'retrievePassword.mobile': 'Mobile',
|
||||
'retrievePassword.mobilePlaceholder': 'Please enter mobile number',
|
||||
'retrievePassword.captcha': 'Verification Code',
|
||||
@@ -400,6 +401,7 @@ export default {
|
||||
'retrievePassword.confirmNewPassword': 'Confirm New Password',
|
||||
'retrievePassword.confirmNewPasswordPlaceholder': 'Please confirm new password',
|
||||
'retrievePassword.getMobileCaptcha': 'Get Verification Code',
|
||||
'retrievePassword.resetButton': 'Reset Password',
|
||||
'retrievePassword.updateButton': 'Update Now',
|
||||
'retrievePassword.goToLogin': 'Back to Login',
|
||||
'retrievePassword.inputCorrectMobile': 'Please enter correct mobile number',
|
||||
@@ -412,6 +414,7 @@ export default {
|
||||
'retrievePassword.newPasswordRequired': 'New password cannot be empty',
|
||||
'retrievePassword.confirmNewPasswordRequired': 'Confirm new password cannot be empty',
|
||||
'retrievePassword.passwordUpdateSuccess': 'Password updated successfully',
|
||||
'retrievePassword.agreeTo': 'Reset means agree',
|
||||
|
||||
// Change password page text
|
||||
'changePassword.title': 'Change Password',
|
||||
|
||||
@@ -389,6 +389,7 @@ export default {
|
||||
// 忘记密码页面文本
|
||||
'retrievePassword.title': '重置密码',
|
||||
'retrievePassword.welcome': '密码找回',
|
||||
'retrievePassword.subtitle': '找回密码',
|
||||
'retrievePassword.mobile': '手机号',
|
||||
'retrievePassword.mobilePlaceholder': '请输入手机号码',
|
||||
'retrievePassword.captcha': '验证码',
|
||||
@@ -400,6 +401,7 @@ export default {
|
||||
'retrievePassword.confirmNewPassword': '确认新密码',
|
||||
'retrievePassword.confirmNewPasswordPlaceholder': '请确认新密码',
|
||||
'retrievePassword.getMobileCaptcha': '获取验证码',
|
||||
'retrievePassword.resetButton': '重置密码',
|
||||
'retrievePassword.updateButton': '立即修改',
|
||||
'retrievePassword.goToLogin': '返回登录',
|
||||
'retrievePassword.inputCorrectMobile': '请输入正确的手机号码',
|
||||
@@ -412,6 +414,7 @@ export default {
|
||||
'retrievePassword.newPasswordRequired': '新密码不能为空',
|
||||
'retrievePassword.confirmNewPasswordRequired': '确认新密码不能为空',
|
||||
'retrievePassword.passwordUpdateSuccess': '密码修改成功',
|
||||
'retrievePassword.agreeTo': '重置即同意',
|
||||
|
||||
// 修改密码页面文本
|
||||
'changePassword.title': '修改密码',
|
||||
|
||||
@@ -389,6 +389,7 @@ export default {
|
||||
// 忘记密码页面文本
|
||||
'retrievePassword.title': '重置密碼',
|
||||
'retrievePassword.welcome': '密碼找回',
|
||||
'retrievePassword.subtitle': '找回密碼',
|
||||
'retrievePassword.mobile': '手機號',
|
||||
'retrievePassword.mobilePlaceholder': '請輸入手機號碼',
|
||||
'retrievePassword.captcha': '驗證碼',
|
||||
@@ -400,6 +401,7 @@ export default {
|
||||
'retrievePassword.confirmNewPassword': '確認新密碼',
|
||||
'retrievePassword.confirmNewPasswordPlaceholder': '請確認新密碼',
|
||||
'retrievePassword.getMobileCaptcha': '獲取驗證碼',
|
||||
'retrievePassword.resetButton': '重置密碼',
|
||||
'retrievePassword.updateButton': '立即修改',
|
||||
'retrievePassword.goToLogin': '返回登錄',
|
||||
'retrievePassword.inputCorrectMobile': '請輸入正確的手機號碼',
|
||||
@@ -412,6 +414,7 @@ export default {
|
||||
'retrievePassword.newPasswordRequired': '新密碼不能為空',
|
||||
'retrievePassword.confirmNewPasswordRequired': '確認新密碼不能為空',
|
||||
'retrievePassword.passwordUpdateSuccess': '密碼修改成功',
|
||||
'retrievePassword.agreeTo': '重置即同意',
|
||||
|
||||
// 修改密码页面文本
|
||||
'changePassword.title': '修改密碼',
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<el-button type="primary" class="send-captcha-btn" :disabled="!canSendMobileCaptcha"
|
||||
@click="sendMobileCaptcha">
|
||||
<span>
|
||||
{{ countdown > 0 ? `${countdown}秒后重试` : $t('retrievePassword.sendCaptcha') }}
|
||||
{{ countdown > 0 ? `${countdown}${$t('register.secondsLater')}` : $t('retrievePassword.getMobileCaptcha') }}
|
||||
</span>
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -67,7 +67,7 @@
|
||||
<!-- 确认新密码 -->
|
||||
<div class="input-box">
|
||||
<img loading="lazy" alt="" class="input-icon" src="@/assets/login/password.png" />
|
||||
<el-input v-model="form.confirmPassword" :placeholder="$t('retrievePassword.confirmPasswordPlaceholder')" type="password" show-password />
|
||||
<el-input v-model="form.confirmPassword" :placeholder="$t('retrievePassword.confirmNewPasswordPlaceholder')" type="password" show-password />
|
||||
</div>
|
||||
|
||||
<!-- 修改底部链接 -->
|
||||
@@ -151,7 +151,7 @@ export default {
|
||||
|
||||
} else {
|
||||
console.error('验证码加载异常:', error);
|
||||
showDanger('验证码加载失败,点击刷新');
|
||||
showDanger(this.$t('register.captchaLoadFailed'));
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -168,12 +168,12 @@ export default {
|
||||
// 发送手机验证码
|
||||
sendMobileCaptcha() {
|
||||
if (!validateMobile(this.form.mobile, this.form.areaCode)) {
|
||||
showDanger('请输入正确的手机号码');
|
||||
showDanger(this.$t('retrievePassword.inputCorrectMobile'));
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证图形验证码
|
||||
if (!this.validateInput(this.form.captcha, '请输入图形验证码')) {
|
||||
if (!this.validateInput(this.form.captcha, this.$t('retrievePassword.captchaRequired'))) {
|
||||
this.fetchCaptcha();
|
||||
return;
|
||||
}
|
||||
@@ -201,9 +201,9 @@ export default {
|
||||
captcha: this.form.captcha,
|
||||
captchaId: this.form.captchaId
|
||||
}, (res) => {
|
||||
showSuccess('验证码发送成功');
|
||||
showSuccess(this.$t('retrievePassword.captchaSendSuccess'));
|
||||
}, (err) => {
|
||||
showDanger(err.data.msg || '验证码发送失败');
|
||||
showDanger(err.data.msg || this.$t('register.captchaSendFailed'));
|
||||
this.countdown = 0;
|
||||
this.fetchCaptcha();
|
||||
});
|
||||
@@ -213,19 +213,19 @@ export default {
|
||||
retrievePassword() {
|
||||
// 验证逻辑
|
||||
if (!validateMobile(this.form.mobile, this.form.areaCode)) {
|
||||
showDanger('请输入正确的手机号码');
|
||||
showDanger(this.$t('retrievePassword.inputCorrectMobile'));
|
||||
return;
|
||||
}
|
||||
if (!this.form.captcha) {
|
||||
showDanger('请输入图形验证码');
|
||||
showDanger(this.$t('retrievePassword.captchaRequired'));
|
||||
return;
|
||||
}
|
||||
if (!this.form.mobileCaptcha) {
|
||||
showDanger('请输入短信验证码');
|
||||
showDanger(this.$t('retrievePassword.mobileCaptchaRequired'));
|
||||
return;
|
||||
}
|
||||
if (this.form.newPassword !== this.form.confirmPassword) {
|
||||
showDanger('两次输入的密码不一致');
|
||||
showDanger(this.$t('retrievePassword.passwordsNotMatch'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -234,11 +234,11 @@ export default {
|
||||
password: this.form.newPassword,
|
||||
code: this.form.mobileCaptcha
|
||||
}, (res) => {
|
||||
showSuccess('密码重置成功');
|
||||
showSuccess(this.$t('retrievePassword.passwordUpdateSuccess'));
|
||||
goToPage('/login');
|
||||
}, (err) => {
|
||||
showDanger(err.data.msg || '重置失败');
|
||||
if (err.data != null && err.data.msg != null && err.data.msg.indexOf('图形验证码') > -1) {
|
||||
showDanger(err.data.msg || this.$t('message.error'));
|
||||
if (err.data != null && err.data.msg != null && (err.data.msg.indexOf('图形验证码') > -1 || err.data.msg.indexOf('Captcha') > -1)) {
|
||||
this.fetchCaptcha()
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user