<!--
 * @Author: sjl
 * @Date: 2023-04-10 11:01:43
 * @Descripttion: 
-->
<template>
  <div class="app-one-container">
    <div id="container-wlw"></div>
  </div>
</template>
<script lang="ts">
  import { defineComponent } from 'vue';

  import { getAppEnvConfig } from '/@/utils/env';
  const { VITE_GLOB_LIGONG_ADMIN } = getAppEnvConfig();
  export default defineComponent({
    components: {},
    setup() {
      return {};
    },
    mounted() {
      window.mic = new MicroFrontend().init();
      this.iframe();
    },
    methods: {
      iframe() {
        if (!window.mic.show) {
          var token = sessionStorage.getItem('token');
          if (token) {
            token = token.replace(/['"]/g, '');
            mic.register('wlw', 'container-wlw', `${VITE_GLOB_LIGONG_ADMIN}?token=${token}`);
            window.mic.show = true;
          }
        }
      },
    },
  });
</script>
<style scoped>
  .app-one-container,
  #iframeapp,
  #container-wlw,
  #container-wlw iframe {
    width: 100%;
    height: 100%;
  }
  #wujie {
    width: 100%;
    height: 100%;
  }
</style>
