You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
640 B
35 lines
640 B
<script setup lang="ts">
|
|
import { useRouter } from "vue-router";
|
|
import { exceptionOb } from "./services/httpRequest";
|
|
import { createWebSocket, sharedWsUrl } from "./services/socket";
|
|
const router = useRouter();
|
|
|
|
exceptionOb.subscribe(exp => {
|
|
if (exp === "invalidToken") {
|
|
router.replace("/login");
|
|
}
|
|
});
|
|
|
|
console.log("ws url: ", sharedWsUrl);
|
|
const wsClient = createWebSocket(sharedWsUrl);
|
|
wsClient.dataOb.subscribe(data => {
|
|
console.log(data);
|
|
});
|
|
wsClient.connect();
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<router-view></router-view>
|
|
</div>
|
|
</template>
|
|
|
|
<style>
|
|
html,
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
</style>
|