Skip to content

Commit

Permalink
Merge pull request #10805 from vhwweng/issue_10678_
Browse files Browse the repository at this point in the history
feat: 全局配置title/footer/logo/favicon/产品名称 #10678
  • Loading branch information
mingshewhe authored Aug 15, 2024
2 parents f2aa5cc + e6fbc95 commit 29519a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/frontend/devops-nav/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { getServiceAliasByPath, ifShowNotice, importScript, importStyle, updateR

import cookie from 'js-cookie'
import compilePath from '../utils/pathExp'
import store from '../store/index'

// 首页 - index
const Index = () => import('../views/Index.vue')
Expand All @@ -19,7 +18,6 @@ const Maintaining = () => import('../views/503.vue')

const UnDeploy = () => import('../views/UnDeploy.vue')

const { platformInfo } = (store.state as any).platFormConfig
Vue.use(Router)

let mod: Route[] = []
Expand Down Expand Up @@ -98,6 +96,7 @@ const createRouter = (store: any, dynamicLoadModule: any, i18n: any) => {
router.beforeEach((to, from, next) => {
const serviceAlias = getServiceAliasByPath(to.path)
const currentPage = window.serviceObject.serviceMap[serviceAlias]
const { platformInfo } = (store.state as any).platFormConfig
if (to.name !== from.name && platformInfo) {
let platformTitle = `${platformInfo.i18n.name || platformInfo.name} | ${platformInfo.i18n.brandName || platformInfo.brandName}`
if (currentPage) {
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/devops-nav/src/utils/iframeUtil.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { showLoginPopup } from '@/utils/util'
import eventBus from './eventBus'
import store from '@/store'
const { platformInfo } = (store.state as any).platFormConfig
interface UrlParam {
url: string
refresh: boolean
Expand All @@ -28,6 +27,7 @@ function iframeUtil (router: any) {
}, '*')
}
utilMap.updateTabTitle = function (title: string): void {
const { platformInfo } = (store.state as any).platFormConfig
if (title) {
document.title = title
} else if (!title && platformInfo) {
Expand Down

0 comments on commit 29519a3

Please sign in to comment.