登錄攔截(轉)
原文地址: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中 。