| 1234567891011121314151617181920212223242526272829303132 |
- <template>
- <router-view />
- </template>
- <script lang="ts" setup>
- import { useNavigation } from '@/hooks/navigation'
- import { dialog } from '@/utils/vant'
- import { useLogin } from '@/business/login'
- import eventBus from '@/services/bus'
- const { userLogout } = useLogin()
- const { backHomePage } = useNavigation()
- const quit = (showLogin = false) => {
- backHomePage({ tabName: 'home', showLogin })
- }
- // 接收用户登出通知
- eventBus.$on('LogoutNotify', (msg) => {
- userLogout(() => {
- if (msg) {
- dialog({
- message: msg as string,
- }).then(() => {
- quit(true)
- })
- } else {
- quit()
- }
- })
- })
- </script>
|