会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
秃头的铲屎官
CnBlogs
Home
New Post
Contact
Admin
Subscription
2020年6月18日
VUE 结合 router 实现全局拦截,验证用户是否登录,没有登录的话,跳到登录界面
1、在 router.js 里面 添加 路由拦截内容: router.beforeEach((to,from,next)=>{ if(to.path '/login'){ next(); }else { let token = localStorage.getItem('userInfo'); if
Read More
posted @ 2020-06-18 14:11 秃头的铲屎官
Views(1012)
Comments(0)
Diggs(0)
公告