<template>
  <GlobalHeader v-if="this.$route.path!=='/auth'"/>
  <div class="main-body">
    <router-view/>
  </div>
  <GlobalFooter v-if="this.$route.path!=='/auth'"/>
</template>

<script>

import GlobalHeader from "@/components/GlobalHeader";
import GlobalFooter from "@/components/GlobalFooter";
export default {
  components: { GlobalFooter, GlobalHeader },
  created() {
    const that = this;
    if (sessionStorage.token) {
      that.$store.commit("storage_load_user");
      that.$store.commit("storage_delete_user");
    }
    window.onbeforeunload = function () {
      if (that.$store.state.user.token) {
        that.$store.commit("storage_save_user");
      }
      return null;
    };
  },
};
</script>

<style lang="scss" scoped>
/*Zhurui修改，消除底部对主体元素的覆盖*/
.main-body {
  margin-bottom: 250px;
}
</style>
