路由拦截

在进行网站登录验证时候,可以使用到beforeEach钩子函数进行验证操作;在router下的index.js文件对路由进行配置

方式一: 通过路径判断

router.beforeEach((to, from, next) => { 
   
  if (to.path === '/Main') { 
   
    next(