营销系统V1_4版本锁版,取消版本号

This commit is contained in:
Apple 2022-08-17 21:46:45 +08:00
parent 855218556e
commit d7bc189aaa
2 changed files with 11 additions and 10 deletions

View File

@ -1,6 +1,7 @@
import { Notify } from "zent"; import { Notify } from "zent";
// export const baseurl = 'https://marketapi.1688sup.com' //镜像环境
const Version = "v1.3.0"; // export const baseurl = 'http://pre.marketapi.1688sup.com'
// const Version = "v1.3.0";
// window.baseurl = 'http://pre.marketapi.1688sup.com' // window.baseurl = 'http://pre.marketapi.1688sup.com'
let baseurl = ""; let baseurl = "";
if (process.env.NODE_ENV == "test" || process.env.NODE_ENV == "development") { if (process.env.NODE_ENV == "test" || process.env.NODE_ENV == "development") {
@ -18,7 +19,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,
}; };
@ -29,7 +30,7 @@ const upload = (method, url, params, responseType) => {
switch (res.status) { switch (res.status) {
// 401: 未登录 // 401: 未登录
case 401: case 401:
res res
.json() .json()
.then((response) => { .then((response) => {
if (response.code == 403) { if (response.code == 403) {
@ -60,7 +61,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") {
@ -116,7 +117,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) {
@ -176,7 +177,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) {
@ -198,7 +199,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,
}), }),
}; };
} }
@ -210,7 +211,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,
}), }),
}; };
} }

View File

@ -162,7 +162,7 @@ const getAccountList = () => {
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.3.0"); // xhr.setRequestHeader("Version", "v1.3.0");
xhr.responseType = "arraybuffer"; xhr.responseType = "arraybuffer";
xhr.onreadystatechange = function (response) { xhr.onreadystatechange = function (response) {
response.header = { response.header = {