fix(系统管理-外观配置): 浏览器title设置

This commit is contained in:
fit2cloud-chenyw 2022-08-22 02:07:27 -04:00
parent 2dec6adae4
commit c059a87284
3 changed files with 36 additions and 12 deletions

View File

@ -5,7 +5,7 @@
<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">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>
<title></title>
</head>
<body>
<noscript>

View File

@ -14,10 +14,11 @@ import {
filterAsyncRouter
} from '@/store/modules/permission'
import {
isMobile
isMobile,
changeFavicon
} from '@/utils/index'
import Layout from '@/layout/index'
// import bus from './utils/bus'
import { getSysUI } from '@/utils/auth'
import { getSocket } from '@/websocket'
@ -27,7 +28,32 @@ NProgress.configure({
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
NProgress.start()
const mobileIgnores = ['/delink']
@ -97,7 +123,7 @@ router.beforeEach(async(to, from, next) => {
NProgress.done()
}
}
})
}))
export const loadMenus = (next, to) => {
buildMenus().then(res => {
const datas = res.data

View File

@ -57,12 +57,12 @@
<div v-if="loginImageUrl && axiosFinished" class="login-image-de" :style="{background:'url(' + loginImageUrl + ') no-repeat', 'backgroundSize':'contain'}" />
</el-col>
</el-row>
</div>
<plugin-com v-if="loginTypes.includes(2) && loginForm.loginType === 2" ref="SSOComponent" component-name="SSOComponent" />
</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>
</template>
@ -165,8 +165,6 @@ export default {
created() {
this.$store.dispatch('user/getUI').then(() => {
// const uiLists = this.$store.state.user.uiInfo
// this.uiInfo = format(uiLists)
this.axiosFinished = true
this.showLoginImage()
}).catch(err => {
@ -206,9 +204,9 @@ export default {
const faviconUrl = '/system/ui/image/' + this.uiInfo['ui.favicon'].paramValue
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'
if(this.showFoot) {
if (this.showFoot) {
const content = this.uiInfo['ui.footContent'] && this.uiInfo['ui.footContent'].paramValue
this.footContent = content
}