Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
X
XiTianSenMall
Project
Project
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
leiqingsong
XiTianSenMall
Commits
13e413d3
Commit
13e413d3
authored
4 years ago
by
leiqingsong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_lqs' into 'master'
修改 See merge request
!77
parents
db1943c0
0572815e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
index.js
H5/src/router/index.js
+26
-26
No files found.
H5/src/router/index.js
View file @
13e413d3
...
...
@@ -163,31 +163,31 @@ const router = new VueRouter({
routes
});
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
console
.
log
(
'to'
,
to
);
const
whiteList
=
[
"MyStatus"
,
"Publish"
,
"FastestProgress"
,
"MonthAward"
,
"Settings"
,
"Grade"
,
"AirDrop"
,
"Invite"
,
"AboutUs"
,
"customerService"
,
"Wallet"
];
const
token
=
localStorage
.
getItem
(
"token"
);
if
(
whiteList
.
indexOf
(
to
.
name
)
>
-
1
)
{
if
(
token
)
{
next
()
}
else
{
console
.
log
(
'未登录'
);
}
}
else
{
next
()
}
})
//
router.beforeEach((to, from, next) => {
//
console.log('to', to);
//
const whiteList = [
//
"MyStatus",
//
"Publish",
//
"FastestProgress",
//
"MonthAward",
//
"Settings",
//
"Grade",
//
"AirDrop",
//
"Invite",
//
"AboutUs",
//
"customerService",
//
"Wallet"
//
];
//
const token = localStorage.getItem("token");
//
if (whiteList.indexOf(to.name) > -1) {
//
if (token) {
//
next()
//
} else {
//
console.log('未登录');
//
}
//
} else {
//
next()
//
}
//
})
export
default
router
;
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