0
积极分子
1、在 router.js 里面 添加 路由拦截内容:
router.beforeEach((to,from,next)=>{ if(to.path ==='/login'){ next(); }else { let token = localStorage.getItem('userInfo'); if(token === null || token === ''){ next('/login'); }else { next(); } } });
使用道具 举报
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com
Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.