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

Merge branch 'scm_optimize' into test

# Conflicts:
#	public/index.html
#	src/api/webSite.js
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
var xhttp = new XMLHttpRequest(); var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() { xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) { if (xhttp.readyState == 4 && xhttp.status == 200) {
var channel_id = JSON.parse(xhttp.response).data.channel_id var channel_id = JSON.parse(xhttp.response).data.channel.id
if (channel_id == 0) { if (channel_id == 0) {
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';
...@@ -229,8 +229,14 @@ ...@@ -229,8 +229,14 @@
}; };
// xhttp.open("GET", '//sysapi.jxhh.com/api/v1/oem/webSite/domainChannel?domain='+ssa+'&field='+op, true); // 正式环境 // xhttp.open("GET", '//sysapi.jxhh.com/api/v1/oem/webSite/domainChannel?domain='+ssa+'&field='+op, true); // 正式环境
// xhttp.open("GET", '//newsys.jxhh.com/api/v1/oem/webSite/domainChannel?domain='+ssa+'&field='+op, true); // 内网开发 // xhttp.open("GET", '//newsys.jxhh.com/api/v1/oem/webSite/domainChannel?domain='+ssa+'&field='+op, true); // 内网开发
xhttp.open("GET", '//192.168.26.179:6601/api/v1/oem/webSite/domainChannel?domain='+ssa+'&field='+op, true); // 测试环境 // xhttp.open("GET", '//192.168.26.179:6601/api/v1/oem/webSite/domainChannel?domain='+ssa+'&field='+op, true); // 测试环境
xhttp.send(); xhttp.open("post", '//'+ ssa +'/api/v1/channelSite/domain/info', true);
let data = {
domain: ssa,
type: 2,
site_type: 4
}
xhttp.send(JSON.stringify(data));
} }
</script> </script>
</html> </html>
...@@ -137,10 +137,10 @@ export function importTemplate() { ...@@ -137,10 +137,10 @@ export function importTemplate() {
}) })
} }
export function getBaseSettingTitle(params) { export function getBaseSettingTitle(data) {
return request({ return request({
url: '/system/oem/getBaseSettingTitle', url: '/system/channelSite/info',
method: 'get', method: 'POST',
params data: data
}) })
} }
import request from '@/utils/request' import request from '@/utils/request'
// 获取渠道id // 获取渠道id
export function indexInfo(params) { export function indexInfo(data) {
return request({ return request({
// url: '//sysapi.jxhh.com/api/v1/oem/webSite/domainChannel', url: '/system/channelSite/info',
url: '//192.168.26.179:6601/api/v1/oem/webSite/domainChannel', // url: '//192.168.26.179:6601/api/v1/oem/webSite/domainChannel',
// url: '//newsys.jxhh.com/api/v1/oem/webSite/domainChannel', // url: '//newsys.jxhh.com/api/v1/oem/webSite/domainChannel',
method: 'get', method: 'post',
params data
}) })
} }
// 获取所有域名 // 获取所有域名
...@@ -44,19 +44,19 @@ export function getallCloudList(params) { ...@@ -44,19 +44,19 @@ export function getallCloudList(params) {
//获取sso域名 //获取sso域名
export function getssoUrl(data) { export function getssoUrl(data) {
return request({ return request({
// url: '//sysapi.jxhh.com/api/v1/oem/webSite/ssoChannel', url: '/channelSite/domain/info',
url: '//192.168.26.179:6601/api/v1/oem/webSite/ssoChannel', // url: '//192.168.26.179:6601/api/v1/oem/webSite/ssoChannel',
// url: '//newsys.jxhh.com/api/v1/oem/webSite/ssoChannel', // url: '//newsys.jxhh.com/api/v1/oem/webSite/ssoChannel',
method: 'get', method: 'post',
params: data data
}) })
} }
// 获取logo // 获取logo
export function backDetailsView(params) { export function backDetailsView(data) {
return request({ return request({
url: '/local/oem/backDetails', url: '/system/channelSite/info',
method: 'get', method: 'post',
params data
}) })
} }
...@@ -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,21 +104,30 @@ export default { ...@@ -101,21 +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 = {
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')
...@@ -123,11 +135,13 @@ export default { ...@@ -123,11 +135,13 @@ export default {
ssooutinfo(){ ssooutinfo(){
var ssa = window.location.host var ssa = window.location.host
let data={ let data={
type: 2,
site_type: 7,
domain:ssa domain:ssa
} }
this.$store.dispatch('getssourl',data).then((res) => { this.$store.dispatch('getssourl',data).then((res) => {
if(res.code==1){ if(res.code==1){
this.ssourl = res.data.sso_url this.ssourl = res.data.channel_site[0].domain
this.logout() this.logout()
} }
}) })
......
...@@ -34,21 +34,35 @@ export default { ...@@ -34,21 +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: 'SHOP', // type: 2,
} // site_type: 4
backDetailsView(params).then(res => { // }
if (res.code == 1) { // backDetailsView(params).then(res => {
this.title = res.data[0]['SHOP'].shop_name // if (res.code == 1) {
this.logo = res.data[0]['SHOP'].shop_logo // this.title = res.data.channel_site[0].base_setting_res.name
} // this.logo = res.data.channel_site[0].base_setting_res.logo
}) // 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 })
......
...@@ -16,11 +16,11 @@ router.beforeEach((to, from, next) => { ...@@ -16,11 +16,11 @@ router.beforeEach((to, from, next) => {
const hasToken = getToken() const hasToken = getToken()
// console.log("getToken()",getToken()) // console.log("getToken()",getToken())
if (hasToken) { if (hasToken) {
if (sessionStorage.getItem('saveTitle')) { // if (sessionStorage.getItem('saveTitle')) {
document.title = sessionStorage.getItem('saveTitle') // document.title = sessionStorage.getItem('saveTitle')
} else { // } else {
getPageTitle() // getPageTitle()
} // }
/* has token*/ /* has token*/
if (to.path === '/platformlogin') { if (to.path === '/platformlogin') {
......
...@@ -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,13 +55,22 @@ const user = { ...@@ -51,13 +55,22 @@ 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 => {
const date = response.data const date = response.data.channel_site[0]
//debugger //debugger
if (response.code == 1) { if (response.code == 1) {
commit('SET_SSOURL', date.access_token) commit('SET_SSOURL', date.domain)
} }
resolve(response) resolve(response)
}).catch(error => { }).catch(error => {
......
...@@ -5,10 +5,14 @@ import { getBaseSettingTitle } from '@/api/system/user' ...@@ -5,10 +5,14 @@ import { getBaseSettingTitle } from '@/api/system/user'
const title = defaultSettings.title || '胜天半子' const title = defaultSettings.title || '胜天半子'
export default function getPageTitle() { export default function getPageTitle() {
getBaseSettingTitle({ type: 'SHOP' }).then(res => { let params = {
type: 2,
site_type: 4
}
getBaseSettingTitle( params ).then(res => {
if (res.code == 1) { if (res.code == 1) {
document.title = res.data document.title = res.data.channel_site[0].base_setting_res.title
sessionStorage.setItem('saveTitle', res.data) sessionStorage.setItem('saveTitle', res.data.channel_site[0].base_setting_res.title)
} }
}) })
} }
\ No newline at end of file
...@@ -613,7 +613,7 @@ ...@@ -613,7 +613,7 @@
// console.log(222,navigator.userAgent); // console.log(222,navigator.userAgent);
}, },
mounted() { mounted() {
this.getIndexInfo() // this.getIndexInfo()
window.addEventListener('scroll', this.handleScroll, true); window.addEventListener('scroll', this.handleScroll, true);
}, },
destroyed() { destroyed() {
...@@ -624,11 +624,23 @@ ...@@ -624,11 +624,23 @@
/** 动态获取 sso 配置域名 */ /** 动态获取 sso 配置域名 */
getssourl() { getssourl() {
var ssa = window.location.host var ssa = window.location.host
let data = {domain: ssa} let data = {
type: 2,
site_type: 7,
domain: ssa
}
this.$store.dispatch('getssourl', data) this.$store.dispatch('getssourl', data)
.then((res) => { .then((res) => {
if (res.code == 1) { if (res.code == 1) {
this.ssourl = res.data.sso_url this.ssourl = res.data.channel_site[0].domain
this.channel_id = res.data.channel.id
this.keyTitle = res.data.channel_site[0].title;
this.keyWords = res.data.channel_site[0].keywords;
this.keyDescriptions = res.data.channel_site[0].describe;
this.getWebSite()
this.getDomain()
this.getAllcloud()
//this.gotosso() //this.gotosso()
} }
}).catch(() => { }).catch(() => {
...@@ -651,15 +663,17 @@ ...@@ -651,15 +663,17 @@
} }
const data = { const data = {
// domain: 'newsys.jxhh.com', // domain: 'newsys.jxhh.com',
domain: ssa, type: 2,
site_type: 4,
// domain: ssa,
// field: op // field: op
} }
indexInfo(data).then(res => { indexInfo(data).then(res => {
if (res.code == 1) { if (res.code == 1) {
this.channel_id = res.data.channel_id this.channel_id = res.data.channel.id
this.keyTitle = res.data.title; this.keyTitle = res.data.channel_site[0].title;
this.keyWords = res.data.keywords; this.keyWords = res.data.channel_site[0].keywords;
this.keyDescriptions = res.data.describe; this.keyDescriptions = res.data.channel_site[0].describe;
this.getWebSite() this.getWebSite()
this.getDomain() this.getDomain()
this.getAllcloud() this.getAllcloud()
......
...@@ -50,11 +50,13 @@ ...@@ -50,11 +50,13 @@
let op = 'open' let op = 'open'
let ssa = window.location.host let ssa = window.location.host
const data = { const data = {
domain: ssa, type: 2,
site_type: 4,
// domain: ssa,
} }
indexInfo(data).then(res => { indexInfo(data).then(res => {
if (res.code == 1) { if (res.code == 1) {
this.channel_id = res.data.channel_id this.channel_id = res.data.channel.id
this.getWebSite() this.getWebSite()
} }
}) })
......
...@@ -45,12 +45,14 @@ export default { ...@@ -45,12 +45,14 @@ export default {
var ssa = window.location.host var ssa = window.location.host
// var ssa = 'scm.jxhh.com' // var ssa = 'scm.jxhh.com'
let data = { let data = {
type: 2,
site_type: 7,
domain:ssa domain:ssa
} }
this.$store.dispatch('getssourl', data) this.$store.dispatch('getssourl', data)
.then((res) => { .then((res) => {
if(res.code==1){ if(res.code==1){
this.ssourl = res.data.sso_url this.ssourl = res.data.channel_site[0].domain
this.tiaozuan() this.tiaozuan()
} }
}) })
......
...@@ -20,12 +20,14 @@ ...@@ -20,12 +20,14 @@
var ssa = window.location.host var ssa = window.location.host
// var ssa = 'scm.jxhh.com' // var ssa = 'scm.jxhh.com'
let data = { let data = {
type: 2,
site_type: 7,
domain:ssa domain:ssa
} }
this.$store.dispatch('getssourl', data) this.$store.dispatch('getssourl', data)
.then((res) => { .then((res) => {
if(res.code==1){ if(res.code==1){
this.ssourl = res.data.sso_url this.ssourl = res.data.channel_site[0].domain
this.gotosso() this.gotosso()
} }
}) })
......
...@@ -408,11 +408,13 @@ ...@@ -408,11 +408,13 @@
getChannelId() { getChannelId() {
let ssa = window.location.host let ssa = window.location.host
const data = { const data = {
domain: ssa, type: 2,
site_type: 4,
// domain: ssa,
} }
indexInfo(data).then(res=> { indexInfo(data).then(res=> {
if (res.code == 1) { if (res.code == 1) {
this.channel_id = res.data.channel_id this.channel_id = res.data.channel.id
} }
}); });
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论