mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 17:54:30 +08:00
support resending verify mail on mobile device
This commit is contained in:
+3
-4
@@ -72,7 +72,9 @@ export default {
|
|||||||
'hoursAheadOfDefaultTimezone': '{hours} hour(s) ahead of default timezone',
|
'hoursAheadOfDefaultTimezone': '{hours} hour(s) ahead of default timezone',
|
||||||
'hoursMinutesBehindDefaultTimezone': '{hours} hour(s) and {minutes} minutes behind default timezone',
|
'hoursMinutesBehindDefaultTimezone': '{hours} hour(s) and {minutes} minutes behind default timezone',
|
||||||
'hoursMinutesAheadOfDefaultTimezone': '{hours} hour(s) and {minutes} minutes ahead of default timezone',
|
'hoursMinutesAheadOfDefaultTimezone': '{hours} hour(s) and {minutes} minutes ahead of default timezone',
|
||||||
'youHaveAccounts': 'You have recorded {count} accounts'
|
'youHaveAccounts': 'You have recorded {count} accounts',
|
||||||
|
'accountActivationAndResendValidationEmailTip': 'Account activation link has been sent to your email address: {email}, If you don\'t receive the mail, please fill password again and click the button below to resend the validation mail.',
|
||||||
|
'resendValidationEmailTip': 'If you don\'t receive the mail, please fill password again and click the button below to resend the validation mail to: {email}'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'dataExport': {
|
'dataExport': {
|
||||||
@@ -854,9 +856,6 @@ export default {
|
|||||||
'PIN code is wrong': 'PIN code is wrong',
|
'PIN code is wrong': 'PIN code is wrong',
|
||||||
'Verify your email': 'Verify your email',
|
'Verify your email': 'Verify your email',
|
||||||
'Verifying...': 'Verifying...',
|
'Verifying...': 'Verifying...',
|
||||||
'Account activation link has been sent to your email address:': 'Account activation link has been sent to your email address:',
|
|
||||||
', If you don\'t receive the mail, fill password and click the button below to resend the verify mail.': ', If you don\'t receive the mail, fill password and click the button below to resend the verify mail.',
|
|
||||||
'If you don\'t receive the mail, fill password and click the button below to resend the verify mail to:': 'If you don\'t receive the mail, fill password and click the button below to resend the verify mail to:',
|
|
||||||
'Resend Validation Email': 'Resend Validation Email',
|
'Resend Validation Email': 'Resend Validation Email',
|
||||||
'Validation email has been sent': 'Validation email has been sent',
|
'Validation email has been sent': 'Validation email has been sent',
|
||||||
'Unable to verify email': 'Unable to verify email',
|
'Unable to verify email': 'Unable to verify email',
|
||||||
|
|||||||
@@ -72,7 +72,9 @@ export default {
|
|||||||
'hoursAheadOfDefaultTimezone': '比默认时区早{hours}小时',
|
'hoursAheadOfDefaultTimezone': '比默认时区早{hours}小时',
|
||||||
'hoursMinutesBehindDefaultTimezone': '比默认时区晚{hours}小时{minutes}分',
|
'hoursMinutesBehindDefaultTimezone': '比默认时区晚{hours}小时{minutes}分',
|
||||||
'hoursMinutesAheadOfDefaultTimezone': '比默认时区早{time}小时{minutes}分',
|
'hoursMinutesAheadOfDefaultTimezone': '比默认时区早{time}小时{minutes}分',
|
||||||
'youHaveAccounts': '您已经记录了 {count} 个账户'
|
'youHaveAccounts': '您已经记录了 {count} 个账户',
|
||||||
|
'accountActivationAndResendValidationEmailTip': '账号激活链接已经发送到您的邮箱地址:{email},如果您没有收到邮件,请再次输入密码并点击下方的按钮重新发送验证邮件。',
|
||||||
|
'resendValidationEmailTip': '如果您没有收到邮件,请再次输入密码并点击下方的按钮重新发送验证邮件到:{email}'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'dataExport': {
|
'dataExport': {
|
||||||
@@ -854,9 +856,6 @@ export default {
|
|||||||
'PIN code is wrong': 'PIN码错误',
|
'PIN code is wrong': 'PIN码错误',
|
||||||
'Verify your email': '验证您的邮箱',
|
'Verify your email': '验证您的邮箱',
|
||||||
'Verifying...': '正在验证...',
|
'Verifying...': '正在验证...',
|
||||||
'Account activation link has been sent to your email address:': '账号激活链接已经发送到您的邮箱地址:',
|
|
||||||
', If you don\'t receive the mail, fill password and click the button below to resend the verify mail.': ',如果您没有收到邮件,输入密码并点击下方的按钮重新发送验证邮件。',
|
|
||||||
'If you don\'t receive the mail, fill password and click the button below to resend the verify mail to:': '如果您没有收到邮件,输入密码并点击下方的按钮重新发送验证邮件到:',
|
|
||||||
'Resend Validation Email': '重发验证邮件',
|
'Resend Validation Email': '重发验证邮件',
|
||||||
'Validation email has been sent': '验证邮件已发送',
|
'Validation email has been sent': '验证邮件已发送',
|
||||||
'Unable to verify email': '无法验证邮箱',
|
'Unable to verify email': '无法验证邮箱',
|
||||||
|
|||||||
@@ -27,13 +27,7 @@
|
|||||||
<p class="mb-0" v-if="token && verified">{{ $t('Email has been verified') }}</p>
|
<p class="mb-0" v-if="token && verified">{{ $t('Email has been verified') }}</p>
|
||||||
<p class="mb-0" v-if="token && !verified && errorMessage">{{ errorMessage }}</p>
|
<p class="mb-0" v-if="token && !verified && errorMessage">{{ errorMessage }}</p>
|
||||||
<p class="mb-0" v-if="!token && !email">{{ $t('Parameter Invalid') }}</p>
|
<p class="mb-0" v-if="!token && !email">{{ $t('Parameter Invalid') }}</p>
|
||||||
<p class="mb-0" v-if="!token && email">
|
<p class="mb-0" v-if="!token && email">{{ $t(hasValidEmailVerifyToken ? 'format.misc.accountActivationAndResendValidationEmailTip' : 'format.misc.resendValidationEmailTip', { email: email }) }}</p>
|
||||||
<span v-if="hasValidEmailVerifyToken">{{ $t('Account activation link has been sent to your email address:') }}</span>
|
|
||||||
<span class="ml-1" v-if="hasValidEmailVerifyToken">{{ email }}</span>
|
|
||||||
<span class="ml-1" v-if="hasValidEmailVerifyToken">{{ $t(', If you don\'t receive the mail, fill password and click the button below to resend the verify mail.') }}</span>
|
|
||||||
<span v-if="!hasValidEmailVerifyToken">{{ $t('If you don\'t receive the mail, fill password and click the button below to resend the verify mail to:') }}</span>
|
|
||||||
<span class="ml-1" v-if="!hasValidEmailVerifyToken">{{ email }}</span>
|
|
||||||
</p>
|
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
|
||||||
<v-card-text class="pb-0 mb-6">
|
<v-card-text class="pb-0 mb-6">
|
||||||
|
|||||||
@@ -162,6 +162,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</f7-page-content>
|
</f7-page-content>
|
||||||
</f7-sheet>
|
</f7-sheet>
|
||||||
|
|
||||||
|
<password-input-sheet :title="$t('Verify your email')"
|
||||||
|
:hint="$t(hasValidEmailVerifyToken ? 'format.misc.accountActivationAndResendValidationEmailTip' : 'format.misc.resendValidationEmailTip', { email: resendVerifyEmail })"
|
||||||
|
:confirm-disabled="requestingResendVerifyEmail"
|
||||||
|
:cancel-disabled="requestingResendVerifyEmail"
|
||||||
|
v-model:show="showVerifyEmailSheet"
|
||||||
|
v-model="currentPasswordForResendVerifyEmail"
|
||||||
|
@password:confirm="requestResendVerifyEmail">
|
||||||
|
</password-input-sheet>
|
||||||
</f7-page>
|
</f7-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -172,7 +181,11 @@ import { useSettingsStore } from '@/stores/setting.js';
|
|||||||
import { useExchangeRatesStore } from '@/stores/exchangeRates.js';
|
import { useExchangeRatesStore } from '@/stores/exchangeRates.js';
|
||||||
|
|
||||||
import assetConstants from '@/consts/asset.js';
|
import assetConstants from '@/consts/asset.js';
|
||||||
import { isUserRegistrationEnabled, isUserForgetPasswordEnabled } from '@/lib/server_settings.js';
|
import {
|
||||||
|
isUserRegistrationEnabled,
|
||||||
|
isUserForgetPasswordEnabled,
|
||||||
|
isUserVerifyEmailEnabled
|
||||||
|
} from '@/lib/server_settings.js';
|
||||||
import { getDesktopVersionPath } from '@/lib/version.js';
|
import { getDesktopVersionPath } from '@/lib/version.js';
|
||||||
import { isModalShowing } from '@/lib/ui.mobile.js';
|
import { isModalShowing } from '@/lib/ui.mobile.js';
|
||||||
|
|
||||||
@@ -188,11 +201,16 @@ export default {
|
|||||||
backupCode: '',
|
backupCode: '',
|
||||||
tempToken: '',
|
tempToken: '',
|
||||||
forgetPasswordEmail: '',
|
forgetPasswordEmail: '',
|
||||||
|
resendVerifyEmail: '',
|
||||||
|
hasValidEmailVerifyToken: false,
|
||||||
|
currentPasswordForResendVerifyEmail: '',
|
||||||
logining: false,
|
logining: false,
|
||||||
verifying: false,
|
verifying: false,
|
||||||
requestingForgetPassword: false,
|
requestingForgetPassword: false,
|
||||||
|
requestingResendVerifyEmail: false,
|
||||||
show2faSheet: false,
|
show2faSheet: false,
|
||||||
showForgetPasswordSheet: false,
|
showForgetPasswordSheet: false,
|
||||||
|
showVerifyEmailSheet: false,
|
||||||
twoFAVerifyType: 'passcode'
|
twoFAVerifyType: 'passcode'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -238,6 +256,9 @@ export default {
|
|||||||
},
|
},
|
||||||
currentLanguageName() {
|
currentLanguageName() {
|
||||||
return this.$locale.getCurrentLanguageDisplayName();
|
return this.$locale.getCurrentLanguageDisplayName();
|
||||||
|
},
|
||||||
|
isUserVerifyEmailEnabled() {
|
||||||
|
return isUserVerifyEmailEnabled();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -261,6 +282,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.logining = true;
|
self.logining = true;
|
||||||
|
self.resendVerifyEmail = '';
|
||||||
|
self.hasValidEmailVerifyToken = false;
|
||||||
|
self.currentPasswordForResendVerifyEmail = '';
|
||||||
self.$showLoading(() => self.logining);
|
self.$showLoading(() => self.logining);
|
||||||
|
|
||||||
self.rootStore.authorize({
|
self.rootStore.authorize({
|
||||||
@@ -290,6 +314,14 @@ export default {
|
|||||||
self.logining = false;
|
self.logining = false;
|
||||||
self.$hideLoading();
|
self.$hideLoading();
|
||||||
|
|
||||||
|
if (self.isUserVerifyEmailEnabled && error.error && error.error.errorCode === 201020 && error.error.context && error.error.context.email) {
|
||||||
|
self.resendVerifyEmail = error.error.context.email;
|
||||||
|
self.hasValidEmailVerifyToken = error.error.context.hasValidEmailVerifyToken || false;
|
||||||
|
self.currentPasswordForResendVerifyEmail = '';
|
||||||
|
self.showVerifyEmailSheet = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!error.processed) {
|
if (!error.processed) {
|
||||||
self.$toast(error.message || error);
|
self.$toast(error.message || error);
|
||||||
}
|
}
|
||||||
@@ -376,6 +408,35 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
requestResendVerifyEmail() {
|
||||||
|
const self = this;
|
||||||
|
|
||||||
|
if (!self.currentPasswordForResendVerifyEmail) {
|
||||||
|
self.$toast('Current password cannot be empty');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.requestingResendVerifyEmail = true;
|
||||||
|
self.$showLoading(() => self.requestingResendVerifyEmail);
|
||||||
|
|
||||||
|
self.rootStore.resendVerifyEmailByUnloginUser({
|
||||||
|
email: self.resendVerifyEmail,
|
||||||
|
password: self.currentPasswordForResendVerifyEmail
|
||||||
|
}).then(() => {
|
||||||
|
self.requestingResendVerifyEmail = false;
|
||||||
|
self.$hideLoading();
|
||||||
|
|
||||||
|
self.$toast('Validation email has been sent');
|
||||||
|
self.showVerifyEmailSheet = false;
|
||||||
|
}).catch(error => {
|
||||||
|
self.requestingResendVerifyEmail = false;
|
||||||
|
self.$hideLoading();
|
||||||
|
|
||||||
|
if (!error.processed) {
|
||||||
|
self.$toast(error.message || error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
switch2FAVerifyType() {
|
switch2FAVerifyType() {
|
||||||
if (this.twoFAVerifyType === 'passcode') {
|
if (this.twoFAVerifyType === 'passcode') {
|
||||||
this.twoFAVerifyType = 'backupcode';
|
this.twoFAVerifyType = 'backupcode';
|
||||||
|
|||||||
Reference in New Issue
Block a user