user settings supports language and date&time format

This commit is contained in:
MaysWind
2023-06-04 21:08:48 +08:00
parent 999ca6274c
commit 0a106026dd
33 changed files with 1082 additions and 285 deletions
+11 -5
View File
@@ -75,14 +75,20 @@ export default {
}
},
created() {
if (this.$user.isUserLogined()) {
if (!this.$settings.isEnableApplicationLock()) {
const self = this;
if (self.$user.isUserLogined()) {
if (!self.$settings.isEnableApplicationLock()) {
// refresh token if user is logined
this.$store.dispatch('refreshTokenAndRevokeOldToken');
self.$store.dispatch('refreshTokenAndRevokeOldToken').then(response => {
if (response.user && response.user.language) {
self.$locale.setLanguage(response.user.language);
}
});
// auto refresh exchange rates data
if (this.$settings.isAutoUpdateExchangeRatesData()) {
this.$store.dispatch('getLatestExchangeRates', { silent: true, force: false });
if (self.$settings.isAutoUpdateExchangeRatesData()) {
self.$store.dispatch('getLatestExchangeRates', { silent: true, force: false });
}
}
}