Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schedule
Overview
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
fengzhaoyu
schedule
Commits
dad5e236
Commit
dad5e236
authored
5 years ago
by
xiexiaoqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fetch 401 relogin
parent
8a2bda89
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
xFetch.js
api/xFetch.js
+4
-2
No files found.
api/xFetch.js
View file @
dad5e236
...
...
@@ -24,11 +24,13 @@ export default function xFetch({ url, method, data, type }) {
if
(
res
.
data
.
code
==
401
)
{
login
();
}
alertOnce
(
'请求异常,请重试'
,
rejects
);
alertOnce
(
res
.
data
.
msg
||
'请求异常,请重试'
,
rejects
);
}
},
fail
:
function
(
err
)
{
console
.
log
(
err
)
if
(
err
&&
err
.
status
==
401
)
{
login
();
}
alertOnce
(
'网络异常,请重试'
,
rejects
);
}
});
...
...
This diff is collapsed.
Click to expand it.
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