提交 ce65efdf authored 作者: 王天霸's avatar 王天霸

title

上级 5c81994d
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
watch: { watch: {
channelInfo() { channelInfo() {
if (this.channelInfo) { if (this.channelInfo) {
this.channel_id = this.channelInfo.channel_site[0].channel_id this.channel_id = this.$store.state.user.channelInfo.channel_id
} }
}, },
}, },
......
...@@ -35,21 +35,31 @@ export default { ...@@ -35,21 +35,31 @@ export default {
} }
}, },
computed: { computed: {
channelInfo() {
return this.$store.getters.channelInfo
}
}, },
watch: { watch: {
channelInfo() {
this.title = this.channelInfo.channel_site[0].base_setting_res.name
this.logo = this.channelInfo.channel_site[0].base_setting_res.logo
document.title = this.channelInfo.channel_site[0].base_setting_res.title
}, },
created() {
const data = {
type: 2,
site_type: 4
}
this.$store.dispatch('getChannelSiteInfo', data).then(res=>{
this.getlog()
})
}, },
mounted() { mounted() {
// this.getBackDetailsView()
}, },
methods: { methods: {
getlog(){
let logotitle = this.$store.state.user.channelInfo
this.title = logotitle.title
this.logo = logotitle.imgUrl
document.title = logotitle.documentTitle
}
// getBackDetailsView() { // getBackDetailsView() {
// let params = { // let params = {
// type: 2, // type: 2,
......
...@@ -50,11 +50,11 @@ export default { ...@@ -50,11 +50,11 @@ export default {
} }
}, },
mounted() { mounted() {
const data = { // const data = {
type: 2, // type: 2,
site_type: 4 // site_type: 4
} // }
this.$store.dispatch('getChannelSiteInfo', data) // this.$store.dispatch('getChannelSiteInfo', data)
}, },
methods: { methods: {
handleClickOutside() { handleClickOutside() {
......
module.exports = { module.exports = {
title: '云仓管理系统', title: '',
/** /**
* 是否系统布局配置 * 是否系统布局配置
......
...@@ -18,7 +18,12 @@ const user = { ...@@ -18,7 +18,12 @@ const user = {
// 3-审核拒绝; // 3-审核拒绝;
applyState: -1, applyState: -1,
cateFee: 0, cateFee: 0,
channelInfo: null channelInfo: {
title:'',
imgUrl:'',
documentTitle: '',
channel_id:''
}
}, },
mutations: { mutations: {
...@@ -59,8 +64,17 @@ const user = { ...@@ -59,8 +64,17 @@ const user = {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
backDetailsView(data).then(response => { backDetailsView(data).then(response => {
if (response.code == 1) { if (response.code == 1) {
commit('SET_CHANNELINFO', response.data) let date = {
title: response.data.channel_site[0].base_setting_res.name,
imgUrl: response.data.channel_site[0].base_setting_res.logo,
documentTitle: response.data.channel_site[0].base_setting_res.title,
channel_id:response.data.channel_site[0].channel_id
}
commit('SET_CHANNELINFO', date)
resolve(response)
} }
}).catch(error => {
reject(error)
}) })
}) })
}, },
...@@ -140,17 +154,17 @@ const user = { ...@@ -140,17 +154,17 @@ const user = {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link'); var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-inon'; link.type = 'image/x-inon';
link.rel = 'icon'; link.rel = 'icon';
link.href = '<%= BASE_URL %>icon.ico' link.href = '/icon.ico'
document.getElementsByTagName('head')[0].appendChild(link); document.getElementsByTagName('head')[0].appendChild(link);
} else { } else {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link'); var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-inon'; link.type = 'image/x-inon';
link.rel = 'icon'; link.rel = 'icon';
link.href = '<%= BASE_URL %>favicon.ico' link.href = '/favicon.ico'
document.getElementsByTagName('head')[0].appendChild(link); document.getElementsByTagName('head')[0].appendChild(link);
} }
document.title = response.data.channel_site[0].title // document.title = response.data.channel_site[0].title
} }
}) })
......
import defaultSettings from '@/settings' import defaultSettings from '@/settings'
import { getBaseSettingTitle } from '@/api/system/user'
const title = defaultSettings.title || '胜天半子' const title = defaultSettings.title || '胜天半子'
\ No newline at end of file
export default function getPageTitle() {
let params = {
type: 2,
site_type: 4
}
getBaseSettingTitle( params ).then(res => {
if (res.code == 1) {
document.title = res.data.channel_site[0].base_setting_res.title
sessionStorage.setItem('saveTitle', res.data.channel_site[0].base_setting_res.title)
}
})
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论