| | |
| | | <template> |
| | | <a-layout class="width-100 flex-display" style="height: 100vh"> |
| | | <a-layout-header class="header"> |
| | | <a-layout-header class="header" v-show="$route.meta.header!=false"> |
| | | <Topbar /> |
| | | </a-layout-header> |
| | | <a-layout-content> |
| | |
| | | import Topbar from '/@/components/common/topbar.vue' |
| | | import { onMounted, reactive, ref, UnwrapRef, watch } from 'vue' |
| | | import { getRoot } from '/@/root' |
| | | import { useRoute } from 'vue-router' |
| | | import { EBizCode, ELocalStorageKey, ERouterName } from '/@/types' |
| | | import { useConnectWebSocket } from '/@/hooks/use-connect-websocket' |
| | | import EventBus from '/@/event-bus' |
| | |
| | | user: string |
| | | password: string |
| | | } |
| | | |
| | | const route = useRoute() |
| | | const root = getRoot() |
| | | |
| | | const messageHandler = async (payload: any) => { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | watch(route, newVal => { |
| | | console.log(newVal, 'val') |
| | | }, { |
| | | immediate: true |
| | | }) |
| | | // 监听ws 消息 |
| | | useConnectWebSocket(messageHandler) |
| | | |
| | | onMounted(() => { |
| | | const token = localStorage.getItem(ELocalStorageKey.Token) |
| | | if (!token) { |
| | | root.$router.push(ERouterName.PROJECT) |
| | | root.$router.push(ERouterName.LOGIN) |
| | | } |
| | | }) |
| | | |