Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
c06d16a1
Commit
c06d16a1
authored
Jan 18, 2018
by
LiuTongTong
Committed by
ddcat1115
Jan 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
减少属性访问 (#731)
* 减少属性访问 * Update request.js
parent
7e336e8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/utils/request.js
src/utils/request.js
+5
-4
No files found.
src/utils/request.js
View file @
c06d16a1
...
@@ -66,21 +66,22 @@ export default function request(url, options) {
...
@@ -66,21 +66,22 @@ export default function request(url, options) {
})
})
.
catch
((
e
)
=>
{
.
catch
((
e
)
=>
{
const
{
dispatch
}
=
store
;
const
{
dispatch
}
=
store
;
if
(
e
.
name
===
401
)
{
const
status
=
e
.
name
;
if
(
status
===
401
)
{
dispatch
({
dispatch
({
type
:
'
login/logout
'
,
type
:
'
login/logout
'
,
});
});
return
;
return
;
}
}
if
(
e
.
name
===
403
)
{
if
(
status
===
403
)
{
dispatch
(
routerRedux
.
push
(
'
/exception/403
'
));
dispatch
(
routerRedux
.
push
(
'
/exception/403
'
));
return
;
return
;
}
}
if
(
e
.
name
<=
504
&&
e
.
name
>=
500
)
{
if
(
status
<=
504
&&
status
>=
500
)
{
dispatch
(
routerRedux
.
push
(
'
/exception/500
'
));
dispatch
(
routerRedux
.
push
(
'
/exception/500
'
));
return
;
return
;
}
}
if
(
e
.
name
>=
404
&&
e
.
name
<
422
)
{
if
(
status
>=
404
&&
status
<
422
)
{
dispatch
(
routerRedux
.
push
(
'
/exception/404
'
));
dispatch
(
routerRedux
.
push
(
'
/exception/404
'
));
}
}
});
});
...
...
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