Commit 64c15153 authored by 牛虎林's avatar 牛虎林

文件下载接口封装

parent d0320a82
...@@ -43,10 +43,12 @@ const transform: AxiosTransform = { ...@@ -43,10 +43,12 @@ const transform: AxiosTransform = {
if (!isTransformResponse) { if (!isTransformResponse) {
return res.data; return res.data;
} }
// 错误的时候返回 // 错误的时候返回
if (!res.data) { if (!res.data) {
return res
// return '[HTTP] Request has no return value'; // return '[HTTP] Request has no return value';
throw new Error(t('sys.api.apiRequestFailed'));
} }
// 这里 code,msg 为 后台统一的字段,需要在 types.ts内修改为项目自己的接口返回格式 // 这里 code,msg 为 后台统一的字段,需要在 types.ts内修改为项目自己的接口返回格式
......
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