@@ -35,10 +35,12 @@ const handleClickMenu = (path: string) => {
router.push(path)
}
const reload = () => {
+ location.reload()
+}
+const relink = () => {
let protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://'
initWebSocket(protocol + window.location.host + '/websocket')
-const relink = () => {}
const path = computed(() => {
return router.currentRoute.value.path
})
@@ -57,7 +57,7 @@ export const lastMessage = ref<any>(null)
// 初始化 WebSocket 连接
export const initWebSocket = (url: string) => {
- console.log('正在初始化 WebSocket 连接...')
+ console.log('正在初始化 WebSocket 连接...', url)
const { status, data, send, open, close } = useWebSocket(url, {
autoReconnect: {