<template>
  <el-config-provider :locale="zhCn">
    <router-view />
  </el-config-provider>
</template>

<!--<script lang="ts">
export default {
  name: 'App',
}
</script>-->

<script lang="ts" setup>
import { useRouter } from 'vue-router'
import { logout } from '@/business/common'
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
import eventBus from '@/services/bus'

const router = useRouter()

// 接收用户登出通知
eventBus.$on('LogoutNotify', () => {
  logout(() => {
    router.replace({ name: 'login' })
  })
})
</script>