<template>
  <div id="app" v-cloak>
    <router-view />
  </div>
</template>

<script>
export default {
  name: "App",
  async created() {
    // 获取登录信息
    if (!(this.$route.path === "/" || this.$route.path === "login")) {
      this.$store
        .dispatch("user/getMenuList", this)
        .then(async (res) => {
          if (res === "noToken") {
            await this.$store.dispatch("user/logout");
            this.$router.push(`/login`);
          } else if (res === "success") {
            console.log("success");
          } else {
            
          }
        })
        .catch((err) => {
          console.log(err);
        });
    }
  },
};
</script>
<style lang="scss">
@import "./assets/css/index.scss";
</style>
