| 123456789101112131415161718192021222324252627282930313233343536 |
- <template>
- <!-- 一级路由 -->
- <router-view />
- </template>
- <!--<script lang="ts">
- export default {
- name: 'App',
- }
- </script>-->
- <script lang="ts" setup>
- import { useRouter } from 'vue-router'
- import { ElMessageBox } from 'element-plus'
- import { useLogin } from '@/business/login'
- import eventBus from '@/services/bus'
- const { userLogout } = useLogin()
- const router = useRouter()
- // 接收用户登出通知
- eventBus.$on('LogoutNotify', (msg) => {
- userLogout(() => {
- if (msg) {
- ElMessageBox.alert(msg as string, '下线通知')
- }
- router.replace({ name: 'login' })
- })
- })
- // 接收风控通知
- eventBus.$on('RiskToWebNtf', (msg) => {
- const notify = msg as { title: string, content: string }
- ElMessageBox.alert(notify.content, notify.title)
- })
- </script>
|