Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jeecg-boot
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
jeecg-boot
Commits
416c8df7
Commit
416c8df7
authored
Sep 29, 2020
by
zhangdaiscott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决token失效 ,登录页面重复跳转登录页面问题
parent
b13a4b01
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
ant-design-vue-jeecg/src/utils/request.js
+4
-6
No files found.
ant-design-vue-jeecg/src/utils/request.js
View file @
416c8df7
...
...
@@ -32,13 +32,9 @@ const err = (error) => {
notification
.
error
({
message
:
'系统提示'
,
description
:
'拒绝访问'
,
duration
:
4
})
break
case
500
:
let
path
=
window
.
location
.
href
//notification.error({ message: '系统提示', description:'Token失效,请重新登录!',duration: 4})
if
(
token
&&
data
.
message
.
includes
(
"Token失效"
)
&&
path
.
indexOf
(
'/user/login'
)
<
0
){
if
(
token
&&
data
.
message
.
includes
(
"Token失效"
)){
// update-begin- --- author:scott ------ date:20190225 ---- for:Token失效采用弹框模式,不直接跳转----
// store.dispatch('Logout').then(() => {
// window.location.reload()
// })
Modal
.
error
({
title
:
'登录已过期'
,
content
:
'很抱歉,登录已过期,请重新登录'
,
...
...
@@ -48,7 +44,9 @@ const err = (error) => {
store
.
dispatch
(
'Logout'
).
then
(()
=>
{
Vue
.
ls
.
remove
(
ACCESS_TOKEN
)
try
{
if
(
path
.
indexOf
(
'/user/login'
)
==-
1
){
let
path
=
window
.
document
.
location
.
pathname
console
.
log
(
"location pathname -> "
+
path
)
if
(
path
!=
"/"
&&
path
.
indexOf
(
'/user/login'
)
==-
1
){
window
.
location
.
reload
()
}
}
catch
(
e
)
{
...
...
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