镜像环境

This commit is contained in:
Apple 2022-07-12 10:48:20 +08:00
parent 1c99827e94
commit 307178d1ce
2 changed files with 21 additions and 22 deletions

View File

@ -1,19 +1,18 @@
import { Notify } from 'zent'
// export const baseurl = 'https://marketapi.1688sup.com'
window.baseurl = 'https://marketapi.1688sup.com'
const Version = 'v1.2.0'
let baseurl = ''
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.116:8056'
// window.baseurl = 'http://192.168.6.116:8056'
}
if (process.env.NODE_ENV == 'production') {
// 生成环境
baseurl = 'https://marketapi.1688sup.com'
}
// window.baseurl = 'https://marketapi.1688sup.com'
// const Version = 'v1.2.0'
window.baseurl = 'http://pre.marketapi.1688sup.com'
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'
// }
// if (process.env.NODE_ENV == 'production') {
// // 生成环境
// baseurl = 'https://marketapi.1688sup.com'
// }
// export let HOST = host;
// export let API_URL = api_url;
// export const baseurl = window.baseurl
@ -22,7 +21,7 @@ const upload = (method, url, params, responseType) => {
method: method,
headers: new Headers({
authorization: sessionStorage.getItem('authorization'),
Version: Version
// Version: Version
}),
body: params
}
@ -64,7 +63,7 @@ const derive = (method, url, params, responseType) => {
responseType: 'blob',
headers: new Headers({
authorization: sessionStorage.getItem('authorization'),
Version: Version
// Version: Version
})
}
if (method == 'get') {
@ -120,7 +119,7 @@ const getData = (method, url, params, responseType) => {
obj = {
headers: new Headers({
authorization: sessionStorage.getItem('authorization'),
Version: Version
// Version: Version
})
}
if (params) {
@ -180,7 +179,7 @@ const req = (method, url, params, responseType) => {
obj = {
headers: new Headers({
authorization: sessionStorage.getItem('authorization'),
Version: Version
// Version: Version
})
}
if (params) {
@ -202,7 +201,7 @@ const req = (method, url, params, responseType) => {
body: JSON.stringify(params),
headers: new Headers({
'Content-Type': 'application/json',
Version: Version
// Version: Version
})
}
}
@ -214,7 +213,7 @@ const req = (method, url, params, responseType) => {
headers: new Headers({
'Content-Type': 'application/json',
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)
}
export { req }
export { req }

View File

@ -148,7 +148,7 @@ function FormDom(props) {
console.log(145, window.baseurl);
const xhr = new XMLHttpRequest();
xhr.open("GET", window.baseurl + "/auth/login/verify");
xhr.setRequestHeader("Version", "v1.2.0");
// xhr.setRequestHeader("Version", "v1.2.0");
xhr.responseType = "arraybuffer";
xhr.onreadystatechange = function (response) {
response.header = {