简单的vue路由守卫
简单的vue路由守卫 不明白路由守卫的可以先去百度一下。。。。。。 要做路由守卫需要以下三点,要是登录注册做好的可以跳过第一步,没有做好的就需要创建缓存了,具体可以百度搜索 1、本地存储方法封装,我的是在src下的assets文件中建立一个本地缓存cookie.js 在cookie.js里写(我是百度别人写好的,嘿嘿!!!) export function setCookie ( c_name , value , expire ) { var date = new Date ( ) date . setSeconds ( date . getSeconds ( ) + expire ) document . cookie = c_name + "=" + escape ( value ) + "; expires=" + date . toGMTString ( ) } export function getCookie ( c_name ) { if ( document . cookie . length > 0 ) { let c_start = document . cookie . indexOf ( c_name + "=" ) if ( c_start != - 1 ) { c_start = c_start + c_name . length + 1 let c