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

接口优化

上级 d4270343
......@@ -211,7 +211,7 @@
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
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) {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-inon';
......@@ -227,10 +227,16 @@
}
}
};
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", '//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>
</html>
......@@ -137,10 +137,10 @@ export function importTemplate() {
})
}
export function getBaseSettingTitle(params) {
export function getBaseSettingTitle(data) {
return request({
url: '/system/oem/getBaseSettingTitle',
method: 'get',
params
url: '/system/channelSite/info',
method: 'POST',
data: data
})
}
import request from '@/utils/request'
// 获取渠道id
export function indexInfo(params) {
export function indexInfo(data) {
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: '//newsys.jxhh.com/api/v1/oem/webSite/domainChannel',
method: 'get',
params
method: 'post',
data
})
}
// 获取所有域名
......@@ -53,10 +53,10 @@ export function getssoUrl(data) {
}
// 获取logo
export function backDetailsView(params) {
export function backDetailsView(data) {
return request({
url: '/local/oem/backDetails',
method: 'get',
params
url: '/system/channelSite/info',
method: 'post',
data
})
}
......@@ -108,11 +108,13 @@ export default {
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
this.channel_id = res.data.channel.id
}
});
},
......
......@@ -40,12 +40,13 @@ export default {
methods: {
getBackDetailsView() {
let params = {
type: 'SHOP',
type: 2,
site_type: 4
}
backDetailsView(params).then(res => {
if (res.code == 1) {
this.title = res.data[0]['SHOP'].shop_name
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
}
})
}
......
......@@ -5,10 +5,14 @@ import { getBaseSettingTitle } from '@/api/system/user'
const title = defaultSettings.title || '胜天半子'
export default function getPageTitle() {
getBaseSettingTitle({ type: 'SHOP' }).then(res => {
let params = {
type: 2,
site_type: 4
}
getBaseSettingTitle( params ).then(res => {
if (res.code == 1) {
document.title = res.data
sessionStorage.setItem('saveTitle', res.data)
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
......@@ -651,15 +651,17 @@
}
const data = {
// domain: 'newsys.jxhh.com',
type: 2,
site_type: 4,
domain: ssa,
// field: op
}
indexInfo(data).then(res => {
if (res.code == 1) {
this.channel_id = res.data.channel_id
this.keyTitle = res.data.title;
this.keyWords = res.data.keywords;
this.keyDescriptions = res.data.describe;
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()
......
......@@ -50,11 +50,13 @@
let op = 'open'
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
this.channel_id = res.data.channel.id
this.getWebSite()
}
})
......
......@@ -408,11 +408,13 @@
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
this.channel_id = res.data.channel.id
}
});
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论