Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
JWTVueDemo
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
Jay
JWTVueDemo
Commits
d9d2cb7b
Commit
d9d2cb7b
authored
Jun 21, 2020
by
Jay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
1f1c9e78
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
JWTVueDemo/ClientApp/src/main.js
+2
-8
No files found.
JWTVueDemo/ClientApp/src/main.js
View file @
d9d2cb7b
...
...
@@ -14,7 +14,7 @@ Vue.config.productionTip = false;
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
// document.title = to.meta.title;
const
isLogin
=
localStorage
.
getItem
(
'authJWT'
)
?
true
:
false
;
if
(
isLogin
)
{
if
(
isLogin
&&
JSON
.
parse
(
atob
(
localStorage
.
getItem
(
'authJWT'
).
split
(
'.'
)[
1
])).
level
!==
undefined
)
{
if
(
to
.
path
===
'/login'
)
{
next
(
'/home'
);
}
else
if
(
to
.
path
===
'/'
)
{
...
...
@@ -39,13 +39,7 @@ router.beforeEach((to, from, next) => {
next
();
}
else
{
localStorage
.
setItem
(
'lastUrl'
,
to
.
fullPath
);
// this.$router.push({ name: 'login', query: { redirect: '/path' } });
next
({
path
:
'/login'
,
query
:
{
nextUrl
:
to
.
fullPath
}
});
next
(
'/login'
);
}
}
});
...
...
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