feat(projects): new i18n function $t & login page and setting drawer config i18n

This commit is contained in:
Soybean
2023-07-23 20:19:47 +08:00
parent 458e387b68
commit 854d0bcf20
49 changed files with 1176 additions and 543 deletions

View File

@ -4,6 +4,7 @@ import { router } from '@/router';
import { fetchLogin, fetchUserInfo } from '@/service';
import { useRouterPush } from '@/composables';
import { localStg } from '@/utils';
import { $t } from '@/locales';
import { useTabStore } from '../tab';
import { useRouteStore } from '../route';
import { getToken, getUserInfo, clearAuthStorage } from './helpers';
@ -68,8 +69,8 @@ export const useAuthStore = defineStore('auth-store', {
// 登录成功弹出欢迎提示
if (route.isInitAuthRoute) {
window.$notification?.success({
title: '登录成功!',
content: `欢迎回来,${this.userInfo.userName}!`,
title: $t('page.login.common.loginSuccess'),
content: $t('page.login.common.welcomeBack', { userName: this.userInfo.userName }),
duration: 3000
});
}

View File

@ -69,7 +69,7 @@ export const useTabStore = defineStore('tab-store', {
const item = this.tabs.find(tab => tab.fullPath === this.activeTab);
if (item) {
if (item.meta.i18nTitle) {
item.meta.i18nTitle = title;
item.meta.i18nTitle = title as I18nType.I18nKey;
} else {
item.meta.title = title;
}