diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index ef1fa3e8..f5abeecd 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -323,6 +323,7 @@ export default { mac:'NE MAC address', macTip:'Able to locate the physical address (MAC) of the network element', port:'Port', + portTip:'Maximum range 0~65535', pvflag:'PV Flag', pnf:'Physical Network Element', vnf:'Virtual Network Element', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index ff36f9f8..efa548f6 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -323,6 +323,7 @@ export default { mac:'网元物理地址', macTip:'能够定位网元的物理地址(MAC)', port:'端口', + portTip:'最大范围0~65535', pvflag:'网元虚拟化标识', pnf:'物理网元', vnf:'虚拟网元', diff --git a/src/router/index.ts b/src/router/index.ts index f9406532..23e9b84c 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -118,8 +118,9 @@ const router = createRouter({ /**全局路由-后置守卫 */ router.afterEach((to, from, failure) => { NProgress.done(); + const title = to.meta?.title // 设置标题 - if (to.meta?.title) { + if (!failure && title) { useAppStore().setTitle(to.meta.title); } }); @@ -132,7 +133,7 @@ router.beforeEach((to, from, next) => { NProgress.start(); const token = getToken(); // 获取系统配置信息 - const appStore = useAppStore(); + const appStore =useAppStore() if (!appStore.loginBackground) { appStore.fnSysConf(); } diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts index fa29a5ad..bc6d9df4 100644 --- a/src/store/modules/app.ts +++ b/src/store/modules/app.ts @@ -101,7 +101,7 @@ const useAppStore = defineStore('app', { actions: { /**设置网页标题 */ setTitle(title?: string) { - if (title) { + if (title && title.indexOf('router.') === -1) { document.title = `${title} - ${this.appName}`; } else { document.title = this.appName; diff --git a/src/views/account/profile.vue b/src/views/account/profile.vue index 20a4a3b3..71c0131f 100644 --- a/src/views/account/profile.vue +++ b/src/views/account/profile.vue @@ -6,7 +6,11 @@ import { reactive, ref, onMounted } from 'vue'; import { parseDateToStr } from '@/utils/date-utils'; import useUserStore from '@/store/modules/user'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; +import { useRoute } from 'vue-router'; +import useAppStore from '@/store/modules/app'; import useI18n from '@/hooks/useI18n'; +const appStore = useAppStore(); +const route = useRoute(); const { t } = useI18n(); /**加载状态 */ @@ -71,7 +75,19 @@ function fnGetProfile() { }); } +/** + * 国际化翻译转换 + */ +function fnLocale() { + let title = route.meta.title as string; + if (title.indexOf('router.') !== -1) { + title = t(title); + } + appStore.setTitle(title); +} + onMounted(() => { + fnLocale(); // 获取信息 fnGetProfile(); }); diff --git a/src/views/account/settings.vue b/src/views/account/settings.vue index e23fc2db..6a65315a 100644 --- a/src/views/account/settings.vue +++ b/src/views/account/settings.vue @@ -1,14 +1,36 @@