登录拦截(转)
原文地址:https://www.cnblogs.com/zjwxy/p/9197627.html
一。路由拦截
项目中某些页面需要用户登录后才可以访问,在路由配置中添加一个字段requireAuth
- 在router/index.js中 。
注:这里判断登录是通过登录成功后将后台返回的token存在localstorage中来判断的
原文地址:https://www.cnblogs.com/zjwxy/p/9197627.html
- 在router/index.js中 。