提交 cb96d406 authored 作者: 郑伟娜's avatar 郑伟娜

优化接口

上级 8a7e558f
...@@ -91,6 +91,9 @@ export default { ...@@ -91,6 +91,9 @@ export default {
value: val value: val
}) })
} }
},
channelInfo() {
return this.$store.getters.channelInfo
} }
}, },
data(){ data(){
...@@ -101,23 +104,30 @@ export default { ...@@ -101,23 +104,30 @@ export default {
}, },
created() { created() {
/** 获取渠道id */ /** 获取渠道id */
this.getChannelId() // this.getChannelId()
}, },
methods: { watch: {
/** 判断渠道 值=0才显示 查看历史数据 链接 */ channelInfo() {
getChannelId() { if (this.channelInfo) {
let ssa = window.location.host this.channel_id = this.channelInfo.channel.id
const data = {
type: 2,
site_type: 4,
// domain: ssa,
} }
indexInfo(data).then(res=> {
if (res.code == 1) {
this.channel_id = res.data.channel.id
}
});
}, },
},
methods: {
/** 判断渠道 值=0才显示 查看历史数据 链接 */
// getChannelId() {
// let ssa = window.location.host
// const data = {
// type: 2,
// site_type: 4,
// // domain: ssa,
// }
// indexInfo(data).then(res=> {
// if (res.code == 1) {
// this.channel_id = res.data.channel.id
// }
// });
// },
toggleSideBar() { toggleSideBar() {
this.$store.dispatch('app/toggleSideBar') this.$store.dispatch('app/toggleSideBar')
......
...@@ -34,23 +34,35 @@ export default { ...@@ -34,23 +34,35 @@ export default {
logo: logoImg logo: logoImg
} }
}, },
computed: {
channelInfo() {
return this.$store.getters.channelInfo
}
},
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
},
},
mounted() { mounted() {
this.getBackDetailsView() // this.getBackDetailsView()
}, },
methods: { methods: {
getBackDetailsView() { // getBackDetailsView() {
let params = { // let params = {
type: 2, // type: 2,
site_type: 4 // site_type: 4
} // }
backDetailsView(params).then(res => { // backDetailsView(params).then(res => {
if (res.code == 1) { // if (res.code == 1) {
this.title = res.data.channel_site[0].base_setting_res.name // this.title = res.data.channel_site[0].base_setting_res.name
this.logo = res.data.channel_site[0].base_setting_res.logo // this.logo = res.data.channel_site[0].base_setting_res.logo
document.title = res.data.channel_site[0].base_setting_res.title // document.title = res.data.channel_site[0].base_setting_res.title
} // }
}) // })
} // }
} }
} }
</script> </script>
......
...@@ -49,6 +49,13 @@ export default { ...@@ -49,6 +49,13 @@ export default {
} }
} }
}, },
mounted() {
const data = {
type: 2,
site_type: 4
}
this.$store.dispatch('getChannelSiteInfo', data)
},
methods: { methods: {
handleClickOutside() { handleClickOutside() {
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false }) this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
......
...@@ -10,6 +10,7 @@ const getters = { ...@@ -10,6 +10,7 @@ const getters = {
introduction: state => state.user.introduction, introduction: state => state.user.introduction,
roles: state => state.user.roles, roles: state => state.user.roles,
permissions: state => state.user.permissions, permissions: state => state.user.permissions,
permission_routes: state => state.permission.routes permission_routes: state => state.permission.routes,
channelInfo: state => state.user.channelInfo
} }
export default getters export default getters
import { login, login2,logout, getInfo, getStatistics } from '@/api/login' import { login, login2,logout, getInfo, getStatistics } from '@/api/login'
import { getssoUrl } from '@/api/webSite' import { getssoUrl, backDetailsView } from '@/api/webSite'
import { getToken, setToken, removeToken } from '@/utils/auth' import { getToken, setToken, removeToken } from '@/utils/auth'
const user = { const user = {
...@@ -18,9 +18,13 @@ const user = { ...@@ -18,9 +18,13 @@ const user = {
// 3-审核拒绝; // 3-审核拒绝;
applyState: -1, applyState: -1,
cateFee: 0, cateFee: 0,
channelInfo: null
}, },
mutations: { mutations: {
SET_CHANNELINFO: (state, channelInfo) => {
state.channelInfo = channelInfo
},
SET_SSOURL:(state,ssourl)=>{ SET_SSOURL:(state,ssourl)=>{
state.ssourl = ssourl state.ssourl = ssourl
}, },
...@@ -51,6 +55,15 @@ const user = { ...@@ -51,6 +55,15 @@ const user = {
}, },
actions: { actions: {
getChannelSiteInfo({commit}, data) {
return new Promise((resolve, reject) => {
backDetailsView(data).then(response => {
if (response.code == 1) {
commit('SET_CHANNELINFO', response.data)
}
})
})
},
getssourl({commit},data){ getssourl({commit},data){
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getssoUrl(data).then(response => { getssoUrl(data).then(response => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论