Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
紫光云
web-project
Commits
64c15153
Commit
64c15153
authored
Jun 25, 2024
by
牛虎林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文件下载接口封装
parent
d0320a82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
index.ts
src/utils/http/axios/index.ts
+3
-1
No files found.
src/utils/http/axios/index.ts
View file @
64c15153
...
@@ -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内修改为项目自己的接口返回格式
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment