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

接口优化

上级 d4270343
...@@ -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';
...@@ -227,10 +227,16 @@ ...@@ -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", '//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
}) })
} }
// 获取所有域名 // 获取所有域名
...@@ -53,10 +53,10 @@ export function getssoUrl(data) { ...@@ -53,10 +53,10 @@ export function getssoUrl(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
}) })
} }
...@@ -108,11 +108,13 @@ export default { ...@@ -108,11 +108,13 @@ export default {
getChannelId() { getChannelId() {
let ssa = window.location.host let ssa = window.location.host
const data = { const data = {
type: 2,
site_type: 4,
domain: ssa, 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
} }
}); });
}, },
......
...@@ -40,12 +40,13 @@ export default { ...@@ -40,12 +40,13 @@ export default {
methods: { methods: {
getBackDetailsView() { getBackDetailsView() {
let params = { let params = {
type: 'SHOP', type: 2,
site_type: 4
} }
backDetailsView(params).then(res => { backDetailsView(params).then(res => {
if (res.code == 1) { if (res.code == 1) {
this.title = res.data[0]['SHOP'].shop_name this.title = res.data.channel_site[0].base_setting_res.name
this.logo = res.data[0]['SHOP'].shop_logo this.logo = res.data.channel_site[0].base_setting_res.logo
} }
}) })
} }
......
...@@ -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
...@@ -651,15 +651,17 @@ ...@@ -651,15 +651,17 @@
} }
const data = { const data = {
// domain: 'newsys.jxhh.com', // domain: 'newsys.jxhh.com',
type: 2,
site_type: 4,
domain: ssa, 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 = {
type: 2,
site_type: 4,
domain: ssa, 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()
} }
}) })
......
...@@ -408,11 +408,13 @@ ...@@ -408,11 +408,13 @@
getChannelId() { getChannelId() {
let ssa = window.location.host let ssa = window.location.host
const data = { const data = {
type: 2,
site_type: 4,
domain: ssa, 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论