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 @@