📜  quasar 路由器身份验证 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:54.805000             🧑  作者: Mango

代码示例1
export default function ({ store /*, ssrContext */ }) {
  // ...
  Router.beforeEach((to, from, next) => {
    if (to.matched.some(record => record.meta.requireAuth) && !store.getters['auth/isSignedIn']) {
      next({ name: 'account-signin', query: { next: to.fullPath } })
    } else {
      next()
    }
  })
  // ...
}