把版本号提出来配置
This commit is contained in:
parent
73f116c23f
commit
72592d6f14
|
@ -1,14 +1,14 @@
|
|||
import {Notify} from "zent"
|
||||
// export const baseurl = 'https://marketapi.1688sup.com'
|
||||
window.baseurl = 'https://marketapi.1688sup.com';
|
||||
|
||||
const Version = "v1.0.2"
|
||||
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.75"
|
||||
window.baseurl = 'http://192.168.6.75';
|
||||
}
|
||||
if (process.env.NODE_ENV == "production") { // 生成环境
|
||||
baseurl = "https://marketapi.1688sup.com"
|
||||
baseurl = "https://marketapi.1688sup.com"
|
||||
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ const upload = (method, url, params, responseType) => {
|
|||
method: method,
|
||||
headers: new Headers({
|
||||
'authorization': sessionStorage.getItem("authorization"),
|
||||
'Version':'v1.0.2'
|
||||
'Version':Version
|
||||
}),
|
||||
body: params,
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ const upload = (method, url, params, responseType) => {
|
|||
responseType: 'blob',
|
||||
headers: new Headers({
|
||||
'authorization': sessionStorage.getItem("authorization"),
|
||||
'Version':'v1.0.2'
|
||||
'Version':Version
|
||||
})
|
||||
};
|
||||
if (method == "get") {
|
||||
|
@ -121,7 +121,7 @@ const upload = (method, url, params, responseType) => {
|
|||
obj = {
|
||||
headers: new Headers({
|
||||
'authorization': sessionStorage.getItem("authorization"),
|
||||
'Version':'v1.0.2'
|
||||
'Version':Version
|
||||
})
|
||||
}
|
||||
if (params) {
|
||||
|
@ -192,7 +192,7 @@ const req = (method, url, params, responseType) => {
|
|||
obj = {
|
||||
headers: new Headers({
|
||||
'authorization': sessionStorage.getItem("authorization"),
|
||||
'Version':'v1.0.2'
|
||||
'Version':Version
|
||||
})
|
||||
}
|
||||
if (params) {
|
||||
|
@ -213,7 +213,7 @@ const req = (method, url, params, responseType) => {
|
|||
body: JSON.stringify(params),
|
||||
headers: new Headers({
|
||||
'Content-Type': 'application/json',
|
||||
'Version':'v1.0.2'
|
||||
'Version':Version
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ const req = (method, url, params, responseType) => {
|
|||
headers: new Headers({
|
||||
'Content-Type': 'application/json',
|
||||
'authorization': sessionStorage.getItem("authorization"),
|
||||
'Version':'v1.0.2'
|
||||
'Version':Version
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue