镜像环境
This commit is contained in:
parent
1c99827e94
commit
307178d1ce
|
@ -1,19 +1,18 @@
|
||||||
import { Notify } from 'zent'
|
import { Notify } from 'zent'
|
||||||
// export const baseurl = 'https://marketapi.1688sup.com'
|
// export const baseurl = 'https://marketapi.1688sup.com'
|
||||||
window.baseurl = 'https://marketapi.1688sup.com'
|
// window.baseurl = 'https://marketapi.1688sup.com'
|
||||||
const Version = 'v1.2.0'
|
// const Version = 'v1.2.0'
|
||||||
let baseurl = ''
|
window.baseurl = 'http://pre.marketapi.1688sup.com'
|
||||||
if (process.env.NODE_ENV == 'test' || process.env.NODE_ENV == 'development') {
|
let baseurl = 'http://pre.marketapi.1688sup.com'
|
||||||
// 测试环境
|
// if (process.env.NODE_ENV == 'test' || process.env.NODE_ENV == 'development') {
|
||||||
baseurl = 'http://192.168.6.75'
|
// // 测试环境
|
||||||
window.baseurl = 'http://192.168.6.75'
|
// baseurl = 'http://192.168.6.75'
|
||||||
// baseurl = 'http://192.168.6.116:8056'
|
// window.baseurl = 'http://192.168.6.75'
|
||||||
// window.baseurl = 'http://192.168.6.116:8056'
|
// }
|
||||||
}
|
// if (process.env.NODE_ENV == 'production') {
|
||||||
if (process.env.NODE_ENV == 'production') {
|
// // 生成环境
|
||||||
// 生成环境
|
// baseurl = 'https://marketapi.1688sup.com'
|
||||||
baseurl = 'https://marketapi.1688sup.com'
|
// }
|
||||||
}
|
|
||||||
// export let HOST = host;
|
// export let HOST = host;
|
||||||
// export let API_URL = api_url;
|
// export let API_URL = api_url;
|
||||||
// export const baseurl = window.baseurl
|
// export const baseurl = window.baseurl
|
||||||
|
@ -22,7 +21,7 @@ const upload = (method, url, params, responseType) => {
|
||||||
method: method,
|
method: method,
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
authorization: sessionStorage.getItem('authorization'),
|
authorization: sessionStorage.getItem('authorization'),
|
||||||
Version: Version
|
// Version: Version
|
||||||
}),
|
}),
|
||||||
body: params
|
body: params
|
||||||
}
|
}
|
||||||
|
@ -64,7 +63,7 @@ const derive = (method, url, params, responseType) => {
|
||||||
responseType: 'blob',
|
responseType: 'blob',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
authorization: sessionStorage.getItem('authorization'),
|
authorization: sessionStorage.getItem('authorization'),
|
||||||
Version: Version
|
// Version: Version
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (method == 'get') {
|
if (method == 'get') {
|
||||||
|
@ -120,7 +119,7 @@ const getData = (method, url, params, responseType) => {
|
||||||
obj = {
|
obj = {
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
authorization: sessionStorage.getItem('authorization'),
|
authorization: sessionStorage.getItem('authorization'),
|
||||||
Version: Version
|
// Version: Version
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (params) {
|
if (params) {
|
||||||
|
@ -180,7 +179,7 @@ const req = (method, url, params, responseType) => {
|
||||||
obj = {
|
obj = {
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
authorization: sessionStorage.getItem('authorization'),
|
authorization: sessionStorage.getItem('authorization'),
|
||||||
Version: Version
|
// Version: Version
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (params) {
|
if (params) {
|
||||||
|
@ -202,7 +201,7 @@ const req = (method, url, params, responseType) => {
|
||||||
body: JSON.stringify(params),
|
body: JSON.stringify(params),
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Version: Version
|
// Version: Version
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,7 +213,7 @@ const req = (method, url, params, responseType) => {
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
authorization: sessionStorage.getItem('authorization'),
|
authorization: sessionStorage.getItem('authorization'),
|
||||||
Version: Version
|
// Version: Version
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -870,4 +869,4 @@ export const addFund = (data, id) => {
|
||||||
return req('post', baseurl + `/codes/voucher/fund/${id}`, data)
|
return req('post', baseurl + `/codes/voucher/fund/${id}`, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
export { req }
|
export { req }
|
|
@ -148,7 +148,7 @@ function FormDom(props) {
|
||||||
console.log(145, window.baseurl);
|
console.log(145, window.baseurl);
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
xhr.open("GET", window.baseurl + "/auth/login/verify");
|
xhr.open("GET", window.baseurl + "/auth/login/verify");
|
||||||
xhr.setRequestHeader("Version", "v1.2.0");
|
// xhr.setRequestHeader("Version", "v1.2.0");
|
||||||
xhr.responseType = "arraybuffer";
|
xhr.responseType = "arraybuffer";
|
||||||
xhr.onreadystatechange = function (response) {
|
xhr.onreadystatechange = function (response) {
|
||||||
response.header = {
|
response.header = {
|
||||||
|
|
Loading…
Reference in New Issue