forked from github/dataease
fix(系统管理-外观配置): 浏览器title设置
This commit is contained in:
parent
2dec6adae4
commit
c059a87284
@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
<title><%= webpackConfig.name %></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<noscript>
|
||||||
|
@ -14,10 +14,11 @@ import {
|
|||||||
filterAsyncRouter
|
filterAsyncRouter
|
||||||
} from '@/store/modules/permission'
|
} from '@/store/modules/permission'
|
||||||
import {
|
import {
|
||||||
isMobile
|
isMobile,
|
||||||
|
changeFavicon
|
||||||
} from '@/utils/index'
|
} from '@/utils/index'
|
||||||
import Layout from '@/layout/index'
|
import Layout from '@/layout/index'
|
||||||
// import bus from './utils/bus'
|
import { getSysUI } from '@/utils/auth'
|
||||||
|
|
||||||
import { getSocket } from '@/websocket'
|
import { getSocket } from '@/websocket'
|
||||||
|
|
||||||
@ -27,7 +28,32 @@ NProgress.configure({
|
|||||||
|
|
||||||
const whiteList = ['/login', '/401', '/404', '/delink', '/nolic'] // no redirect whitelist
|
const whiteList = ['/login', '/401', '/404', '/delink', '/nolic'] // no redirect whitelist
|
||||||
|
|
||||||
router.beforeEach(async(to, from, next) => {
|
const routeBefore = (callBack) => {
|
||||||
|
let uiInfo = getSysUI()
|
||||||
|
if (!uiInfo || Object.keys(uiInfo).length === 0) {
|
||||||
|
store.dispatch('user/getUI').then(() => {
|
||||||
|
document.title = getPageTitle()
|
||||||
|
uiInfo = getSysUI()
|
||||||
|
if (uiInfo['ui.favicon'] && uiInfo['ui.favicon'].paramValue) {
|
||||||
|
const faviconUrl = '/system/ui/image/' + this.uiInfo['ui.favicon'].paramValue
|
||||||
|
changeFavicon(faviconUrl)
|
||||||
|
}
|
||||||
|
callBack()
|
||||||
|
}).catch(err => {
|
||||||
|
document.title = getPageTitle()
|
||||||
|
console.error(err)
|
||||||
|
callBack()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
document.title = getPageTitle()
|
||||||
|
if (uiInfo['ui.favicon'] && uiInfo['ui.favicon'].paramValue) {
|
||||||
|
const faviconUrl = '/system/ui/image/' + this.uiInfo['ui.favicon'].paramValue
|
||||||
|
changeFavicon(faviconUrl)
|
||||||
|
}
|
||||||
|
callBack()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
router.beforeEach(async(to, from, next) => routeBefore(() => {
|
||||||
// start progress bar
|
// start progress bar
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
const mobileIgnores = ['/delink']
|
const mobileIgnores = ['/delink']
|
||||||
@ -97,7 +123,7 @@ router.beforeEach(async(to, from, next) => {
|
|||||||
NProgress.done()
|
NProgress.done()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}))
|
||||||
export const loadMenus = (next, to) => {
|
export const loadMenus = (next, to) => {
|
||||||
buildMenus().then(res => {
|
buildMenus().then(res => {
|
||||||
const datas = res.data
|
const datas = res.data
|
||||||
|
@ -57,12 +57,12 @@
|
|||||||
<div v-if="loginImageUrl && axiosFinished" class="login-image-de" :style="{background:'url(' + loginImageUrl + ') no-repeat', 'backgroundSize':'contain'}" />
|
<div v-if="loginImageUrl && axiosFinished" class="login-image-de" :style="{background:'url(' + loginImageUrl + ') no-repeat', 'backgroundSize':'contain'}" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<plugin-com v-if="loginTypes.includes(2) && loginForm.loginType === 2" ref="SSOComponent" component-name="SSOComponent" />
|
<plugin-com v-if="loginTypes.includes(2) && loginForm.loginType === 2" ref="SSOComponent" component-name="SSOComponent" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showFoot" class="dynamic-login-foot" v-html="footContent"></div>
|
<div v-if="showFoot" class="dynamic-login-foot" v-html="footContent" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -165,8 +165,6 @@ export default {
|
|||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.$store.dispatch('user/getUI').then(() => {
|
this.$store.dispatch('user/getUI').then(() => {
|
||||||
// const uiLists = this.$store.state.user.uiInfo
|
|
||||||
// this.uiInfo = format(uiLists)
|
|
||||||
this.axiosFinished = true
|
this.axiosFinished = true
|
||||||
this.showLoginImage()
|
this.showLoginImage()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
@ -206,9 +204,9 @@ export default {
|
|||||||
const faviconUrl = '/system/ui/image/' + this.uiInfo['ui.favicon'].paramValue
|
const faviconUrl = '/system/ui/image/' + this.uiInfo['ui.favicon'].paramValue
|
||||||
changeFavicon(faviconUrl)
|
changeFavicon(faviconUrl)
|
||||||
}
|
}
|
||||||
if(this.uiInfo['ui.showFoot'] && this.uiInfo['ui.showFoot'].paramValue) {
|
if (this.uiInfo['ui.showFoot'] && this.uiInfo['ui.showFoot'].paramValue) {
|
||||||
this.showFoot = this.uiInfo['ui.showFoot'].paramValue === true || this.uiInfo['ui.showFoot'].paramValue === 'true'
|
this.showFoot = this.uiInfo['ui.showFoot'].paramValue === true || this.uiInfo['ui.showFoot'].paramValue === 'true'
|
||||||
if(this.showFoot) {
|
if (this.showFoot) {
|
||||||
const content = this.uiInfo['ui.footContent'] && this.uiInfo['ui.footContent'].paramValue
|
const content = this.uiInfo['ui.footContent'] && this.uiInfo['ui.footContent'].paramValue
|
||||||
this.footContent = content
|
this.footContent = content
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user