Commit 0572815e authored by leiqingsong's avatar leiqingsong

修改

parent 02e04209
......@@ -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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment