<template>
  <div id="app">
    <bd-menu class="outmenu"></bd-menu>
    <router-view />
  </div>
</template>

<script>
import bdMenu from "./components/menu";
export default {
  data: () => ({}),
  components: {
    bdMenu
  },
  methods: {
    getCurrentUser() {
      this.$api.user.getNowUser().then(({ data }) => {
        if (data.success == 1) {
          console.log("--- --- ---");
          console.log(data.data);
          console.log("--- --- ---");
          this.$store.commit("userInfofun", data.data);
          if (data.data.is_admin == 1 || data.data.is_admin == 2) {
            this.$router.push({ name: "workPlace" });
          }
        } else {
          console.log(data.errMsg);
        }
      });
    }
  },
  created() {
    this.getCurrentUser();
  }
};
</script>

<style scoped>
.outmenu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
}
#app {
  background-color: #f6f7fb;
  font-size: 14px;
}
</style>
