提交 d4d098de authored 作者: vipcxj's avatar vipcxj

fix:auth为false时,中间件返回undefined

上级 e0012d58
......@@ -49,6 +49,12 @@ export default {
onRequest: async (url, params, options, auth) => {
if (auth) {
return putTokenOnUrl(url, params, options);
} else {
return {
url,
options,
params,
};
}
},
onResponse: parseResponse,
......@@ -57,6 +63,13 @@ export default {
onRequest: async (url, data, params, options, auth) => {
if (auth) {
return putTokenToBody(url, data, params, options);
} else {
return {
url,
params,
options,
data,
};
}
},
onResponse: parseResponse,
......@@ -65,6 +78,12 @@ export default {
onRequest: async (url, params, options, auth) => {
if (auth) {
return putTokenOnUrl(url, params, options);
} else {
return {
url,
options,
params,
};
}
},
onResponse: parseResponse,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论