From fdea342eec9a3f8fd951d17796788dddefa921ea Mon Sep 17 00:00:00 2001
From: zhaoyz <11@22.com>
Date: Tue, 16 Apr 2024 17:22:59 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/ws.ts | 46 ---
src/views/index.vue | 1 -
src/views/remote-manage/remote-manage.vue | 439 +++++++++++-----------
3 files changed, 227 insertions(+), 259 deletions(-)
delete mode 100644 src/api/ws.ts
diff --git a/src/api/ws.ts b/src/api/ws.ts
deleted file mode 100644
index 07a0189..0000000
--- a/src/api/ws.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-let ws: WebSocket;
-
-function init(url: string | URL, protocols?: string | string[]) {
- return new Promise(resolve => {
- try {
- ws = new WebSocket(url);
- resolve(true)
- } catch (e) {
- console.log(e)
- }
- })
-}
-
-function close(code?: number, reason?: string) {
- ws.close(code, reason)
-}
-
-function send(data: string | ArrayBufferLike | Blob | ArrayBufferView) {
- ws.send(data)
-}
-
-function closeListener(cb: any) {
- ws.onclose = cb
-}
-
-function openListener(cb: any) {
- ws.onopen = cb
-}
-
-function errorListener(cb: any) {
- ws.onerror = cb
-}
-
-function messageListener(cb: any) {
- ws.onmessage = cb
-}
-
-export const wsApi= {
- init,
- close,
- send,
- closeListener,
- openListener,
- errorListener,
- messageListener
-}
\ No newline at end of file
diff --git a/src/views/index.vue b/src/views/index.vue
index 6c45ef4..4233d57 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -67,7 +67,6 @@ import {ElMessage, ElMessageBox} from 'element-plus'
import {useLoginStore} from '@/stores/user-info-store'
import {getHospitalsData} from '@/static-data/core'
import userInfoForm from '@/components/user-info.vue'
-import {wsApi} from "@/api/ws";
import {Session} from "@/utils/storage";
import {logout} from "@/api/login";
diff --git a/src/views/remote-manage/remote-manage.vue b/src/views/remote-manage/remote-manage.vue
index 0babbd9..bd4d839 100644
--- a/src/views/remote-manage/remote-manage.vue
+++ b/src/views/remote-manage/remote-manage.vue
@@ -1,41 +1,41 @@
-
-
+
+