diff --git a/.env.development b/.env.development index 22044d5..db30e98 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ # 页面标题 -VITE_APP_TITLE = v1xxx管理系统 +VITE_APP_TITLE = dev管理系统 # 开发环境配置 VITE_APP_ENV = 'development' diff --git a/.env.production b/.env.production index 6c29bd6..89c2888 100644 --- a/.env.production +++ b/.env.production @@ -1,5 +1,5 @@ # 页面标题 -VITE_APP_TITLE = 2xxx管理系统 +VITE_APP_TITLE = pro管理系统 # 生产环境配置 VITE_APP_ENV = 'production' diff --git a/.env.staging b/.env.staging index 412c0af..d287374 100644 --- a/.env.staging +++ b/.env.staging @@ -1,5 +1,5 @@ # 页面标题 -VITE_APP_TITLE = 3管理系统 +VITE_APP_TITLE = stage管理系统 # 生产环境配置 VITE_APP_ENV = 'staging' diff --git a/src/utils/dynamicTitle.js b/src/utils/dynamicTitle.js index 768583e..3d0f0c6 100644 --- a/src/utils/dynamicTitle.js +++ b/src/utils/dynamicTitle.js @@ -8,6 +8,28 @@ export function useDynamicTitle() { if (store.state.settings.dynamicTitle) { document.title = store.state.settings.title + ' - ' + defaultSettings.title; } else { - document.title = defaultSettings.title; + document.title = getTitle() + defaultSettings.title; } +} + +export function getTitle() { + let title = '' + const role = localStorage.getItem('select_identity') + if (role == 1) { + // 企业 + title = '企业' + } else if (role == 2) { + // 专家 + title = '专家' + } else if (role == 4) { + // 研究机构 + title = '研究机构' + } else if (role == 8) { + // 实验室 + title = '实验室' + } else if (role == 16) { + // 科技经纪人 + title = '科技经纪人' + } + return title } \ No newline at end of file