<template>
  <router-view />
</template>
<script>
import { defineComponent, watchEffect } from 'vue'
// import {useRouter} from 'vue-router'

import store from '@/store'

export default defineComponent({
  setup() {
    let hasToken = store.getters['user/accessToken']
    // let router = useRouter();

    watchEffect((fn, options) => {
      fn, options
      if (!hasToken) {
        // router.push({
        //   path: '/login',
        // })
      } else {
        console.log(2)

      }
    })
    return {
      store,
    }
  },
})

</script>

<style lang="less">
@import '~@/vab/styles/vab.less';
</style>
