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

<script>
import { getSsoToken_CK } from './utils/auth'
import RightBar from '@/components/RightBar'
export default {
  name: 'App',
  components: { RightBar },
  computed: {
    currentSSOToken() {
      return this.$store.state.app.currentSSOToken
    }
  },
  updated() {
    // 判断浏览器窗口多用户，true则刷新页面菜单
    if (this.currentSSOToken) {
      if (this.currentSSOToken !== getSsoToken_CK()) {
        location.reload()
      }
    } else {
      this.$store.commit('app/SET_CURRENTSSOTOKEN', getSsoToken_CK())
    }
  }
}
</script>
