Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dcxy-manage-shell
Project
Overview
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
姜雷
dcxy-manage-shell
Commits
aeeda94f
Commit
aeeda94f
authored
May 08, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
当取消请求时不提示错误
parent
5b061966
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
validate.js
src/api/validate.js
+10
-5
No files found.
src/api/validate.js
View file @
aeeda94f
import
{
isCancel
}
from
'axios'
;
import
{
Message
,
MessageBox
}
from
'element-ui'
;
import
store
from
'../store'
;
...
...
@@ -37,10 +38,14 @@ export const errorHandle = error => {
});
return
Promise
.
reject
({
error
,
msg
:
'请求超时!'
});
}
Message
({
message
:
error
.
message
,
type
:
'error'
,
duration
:
5
*
1000
,
});
if
(
isCancel
(
error
))
{
console
.
log
(
'取消请求'
);
}
else
{
Message
({
message
:
error
.
message
,
type
:
'error'
,
duration
:
5
*
1000
,
});
}
return
Promise
.
reject
(
error
);
};
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