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

<script>
  import {getByTenantId} from "./api/system/setting";

  export default {
    name: "app",
    data() {
      return {};
    },
    watch: {},
    created() {

    },
    methods: {
      coverIcon(){
        var iconLink = document.querySelector('link[rel="icon"]');
        getByTenantId(JSON.parse(sessionStorage.getItem("saber-tenantId")).content).then(res =>{
          var options = res.data.data ? res.data.data : res.data;
          if (options.indexLogo){
            iconLink.href = options.indexLogo;
          }
        });
      }
    },
    computed: {},
    mounted() {
      window.addEventListener('setItem', (e) => {
        if (e.key == "index-options"){
          location.href = "../src/views/wel/index.vue"
          location.reload()
          // this.$route.location.reload()

        }
      });
      this.coverIcon();
    },
  };
</script>
<style lang="scss">
  #app {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
</style>
