当前位置:   article > 正文

前端配url地址,添加白名单_h5将页面摘出为白名单怎么弄

h5将页面摘出为白名单怎么弄

permission.js文件中添加‘/SmallWaterDrop’为要配的页面为白名单,然后用路由守卫判断,要进的页面是不是想要加入白名单的页面,如果是的话,就next()进入页面,不需要登录

const whiteList = ['/login','/SmallWaterDrop']
router.beforeEach(async(to, from, next) => {
  console.log(to.path)
  console.log(14,whiteList.indexOf(to.path) !== -1)
  if (whiteList.indexOf(to.path) !== -1) {
    next();
  }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号