<template>
  <sh-layout @getAccessToken="getAccessToken">
    <RightNav v-if="user && user.id"></RightNav>
  </sh-layout>
</template>

<script>
import RightNav from './components/RightNav' 
import { mapState } from 'vuex'
import start from '@/qiankun/index'
export default {
  components: {
    ShLayout: SANHUI.Layout,
    RightNav
  },
  computed: {
    ...mapState(['user'])
  },
  mounted() {
    // 启动微前端
    if (!window.qiankunStarted) {
      window.qiankunStarted = true
      start({
        singular: false,
        excludeAssetFilter: (assetUrl) => {
          // 过滤baidu
          const wihiteWords = ['baidu']
          if (wihiteWords.includes(assetUrl)) {
            return true
          }
          return wihiteWords.some(w => {
            return assetUrl.includes(w)
          })
        }
      })
    }
  },

  data() {
    return {

    };
  },

  methods : {
    getAccessToken() {
  
    }
  }
}
</script>
