Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
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
linweijiong
jinfa-platform
Commits
cad9acb7
Commit
cad9acb7
authored
Jun 11, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
全局接口错误提示
parent
13d21ecd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
request.ts
src/utils/request.ts
+3
-1
No files found.
src/utils/request.ts
View file @
cad9acb7
...
@@ -91,8 +91,10 @@ class ApiRequest {
...
@@ -91,8 +91,10 @@ class ApiRequest {
baseRequest
<
IRequestSuccess
<
T
>>
(
url
,
options
).
then
(
res
=>
{
baseRequest
<
IRequestSuccess
<
T
>>
(
url
,
options
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
options
.
ctlType
===
'message'
&&
message
.
success
(
res
.
message
)
options
.
ctlType
===
'message'
&&
message
.
success
(
res
.
message
)
}
resolve
(
res
)
resolve
(
res
)
}
else
{
message
.
error
(
res
.
message
)
}
}).
catch
((
err
:
IRequestError
)
=>
{
}).
catch
((
err
:
IRequestError
)
=>
{
// http错误处理, 直接透传
// http错误处理, 直接透传
reject
(
err
)
reject
(
err
)
...
...
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