|
@ -48,11 +48,13 @@ import { createWebSocket, sharedWsUrl } from "@/services/socket"; |
|
|
|
|
|
|
|
|
const route = useRoute(); |
|
|
const route = useRoute(); |
|
|
const router = useRouter(); |
|
|
const router = useRouter(); |
|
|
const isWifiNormal = ref(true); |
|
|
|
|
|
|
|
|
const isWifiNormal = ref(false); |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
const wsClient = createWebSocket(sharedWsUrl); |
|
|
const wsClient = createWebSocket(sharedWsUrl); |
|
|
|
|
|
console.log(23333333) |
|
|
const subscription = wsClient.stateOb.subscribe(state => { |
|
|
const subscription = wsClient.stateOb.subscribe(state => { |
|
|
|
|
|
console.log(state); |
|
|
isWifiNormal.value = state === "open"; |
|
|
isWifiNormal.value = state === "open"; |
|
|
}); |
|
|
}); |
|
|
onUnmounted(() => { |
|
|
onUnmounted(() => { |
|
|