|
|
|
|
@ -29,10 +29,11 @@ export const registerRouter = (routerP) => {
@@ -29,10 +29,11 @@ export const registerRouter = (routerP) => {
|
|
|
|
|
_axios.interceptors.request.use( |
|
|
|
|
function (config) { |
|
|
|
|
const time = new Date().getTime().toString(); |
|
|
|
|
const params = config.params; |
|
|
|
|
if (params) { |
|
|
|
|
const params = new URLSearchParams(config.params); |
|
|
|
|
if (params.toString()) { |
|
|
|
|
delEmpty(params); |
|
|
|
|
params.t = time; |
|
|
|
|
params.append("t", time); |
|
|
|
|
config.params = params; |
|
|
|
|
} |
|
|
|
|
const data = config.data; |
|
|
|
|
if (data != null && typeof data === "object") { |
|
|
|
|
@ -47,7 +48,11 @@ _axios.interceptors.request.use(
@@ -47,7 +48,11 @@ _axios.interceptors.request.use(
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
function delEmpty(data) { |
|
|
|
|
if (data) { |
|
|
|
|
if (data && data instanceof URLSearchParams) { |
|
|
|
|
for (const [k, v] of data.entries()) { |
|
|
|
|
if (!v) data.delete(k); |
|
|
|
|
} |
|
|
|
|
} else if (data && typeof data === "object") { |
|
|
|
|
for (const item in data) { |
|
|
|
|
if (data.hasOwnProperty(item)) { |
|
|
|
|
const val = data[item]; |
|
|
|
|
|