!50 add 新增 前端接入websocket接收消息

*  add 新增 前端接入websocket接收消息
This commit is contained in:
三个三
2023-11-02 04:36:31 +00:00
committed by 疯狂的狮子Li
parent 1e3f18ce22
commit a8a334b3c3
8 changed files with 344 additions and 0 deletions

View File

@ -96,6 +96,11 @@
</template>
<script setup name="Index" lang="ts">
import { initWebSocket } from '@/utils/websocket';
onMounted(() => {
initWebSocket("ws://"+window.location.host+import.meta.env.VITE_APP_BASE_API+"/resource/websocket");
});
const goTarget = (url:string) => {
window.open(url, '__blank')