Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-05-19 23:48:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
43912d1422390fd4f3b156defe4a44440d131105
43912d14
1 parent
b89d52c5
fix 拦截器屏蔽错误问题优化
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
src/utils/axios.js
src/utils/axios.js
View file @
43912d1
...
...
@@ -36,6 +36,8 @@ axios.interceptors.request.use(
*/
axios
.
interceptors
.
response
.
use
(
response
=>
{
// 默认显示
response
.
data
.
show
=
true
;
// C/B授权拼接头特殊标识,openid_x
let
userType
=
router
&&
router
.
currentRoute
.
value
.
href
?.
indexOf
(
'business'
)
>
0
?
'b'
:
'c'
;
if
(
response
.
data
.
code
===
401
)
{
...
...
@@ -51,8 +53,6 @@ axios.interceptors.response.use(
}
});
}
// 默认显示
response
.
data
.
show
=
true
;
// 拦截B端未登录情况
if
(
response
.
data
.
msg
===
'老师请先登录!'
||
response
.
data
.
msg
===
'老师不存在!'
)
{
router
.
replace
({
...
...
Please
register
or
login
to post a comment