Commit c3565225 by 姜雷

修改请求过滤文件类型请求结果

parent 73fe7f65
...@@ -41,7 +41,9 @@ const createBaseFetch = config => { ...@@ -41,7 +41,9 @@ const createBaseFetch = config => {
if (res.code !== 1000) { if (res.code !== 1000) {
if ( if (
response.headers && response.headers &&
/application\/octet-stream/.test(response.headers['content-type']) /application\/octet-stream/.test(
response.headers['content-type'].toLowerCase()
)
) { ) {
return response; return response;
} }
......
...@@ -56,7 +56,9 @@ service.interceptors.response.use(response => { ...@@ -56,7 +56,9 @@ service.interceptors.response.use(response => {
if (res.code !== SUCCESS_CODE) { if (res.code !== SUCCESS_CODE) {
if ( if (
response.headers && response.headers &&
response.headers['content-type'] === 'application/octet-stream' /application\/octet-stream/.test(
response.headers['content-type'].toLowerCase()
)
) { ) {
return response; return response;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment