code refactor

This commit is contained in:
MaysWind
2021-04-05 22:27:08 +08:00
parent d43e7fa542
commit 5da71ff4ff
8 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -197,7 +197,7 @@ export default {
confirmPassword: '',
email: '',
nickname: '',
defaultCurrency: self.$t('default.currency'),
defaultCurrency: self.$store.state.defaultSetting.currency,
firstDayOfWeek: self.$constants.datetime.allWeekDays[self.$t('default.firstDayOfWeek')] ? self.$constants.datetime.allWeekDays[self.$t('default.firstDayOfWeek')].type : 0
},
submitting: false,
@@ -227,13 +227,13 @@ export default {
return this.$i18n.locale;
},
set: function (value) {
const isCurrencyDefault = this.user.defaultCurrency === this.$t('default.currency');
const isCurrencyDefault = this.user.defaultCurrency === this.$store.state.defaultSetting.currency;
const isFirstWeekDayDefault = this.user.firstDayOfWeek === (this.$constants.datetime.allWeekDays[this.$t('default.firstDayOfWeek')] ? this.$constants.datetime.allWeekDays[this.$t('default.firstDayOfWeek')].type : 0);
this.$locale.setLanguage(value);
if (isCurrencyDefault) {
this.user.defaultCurrency = this.$t('default.currency');
this.user.defaultCurrency = this.$store.state.defaultSetting.currency;
}
if (isFirstWeekDayDefault) {