카테고리 없음

vue 정리 하기

THE HEYDAZE 2021. 11. 12. 00:27

https://stackoverflow.com/questions/54677736/vuejs-pass-parameters-through-the-router-next/54677884

 

https://stackoverflow.com/questions/49934179/how-to-pass-parameters-on-redirecting-using-vue-router

 

 

AuthorizePage





router.beforeEach((to, from, next) => {
  const auth = to.meta?.auth || false
  const email = store.state.me?.email || ''

  if (auth && email !== 'admin@gmail.com')
    return next({
      path: '/402',
      params: { id: 3 },
      // query: { message: '402 접근이 제한된 페이지 입니다' },
    })
  next()
})