This commit is contained in:
2022-07-06 16:59:18 +08:00
parent 89ebeeb791
commit a227548f38
20 changed files with 228 additions and 171 deletions

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2022-03-07 15:31:13
* @LastEditors: zwq
* @LastEditTime: 2022-07-05 16:12:59
* @LastEditTime: 2022-07-06 16:08:05
* @Description:
-->
<template>
@@ -30,7 +30,7 @@ export default {
},
created () {
const baseurl = window.SITE_CONFIG.baseUrl
this.url = baseurl.slice(5)
this.url = baseurl.substring(5, baseurl.length - 4)
this.initWebSocket()
},
destroyed () {
@@ -51,7 +51,7 @@ export default {
},
websocketonopen () {
// 连接建立之后执行send方法发送数据
this.websocketsend(JSON.stringify())
this.websocketsend(JSON.stringify('2'))
},
websocketonerror () {
// 连接建立失败重连
@@ -59,13 +59,12 @@ export default {
},
websocketonmessage (e) {
// 数据接收
console.log(e.data)
this.wbData = JSON.parse(e.data)
console.log(this.wbData)
},
websocketsend () {
websocketsend (val) {
// 数据发送
this.websock.send()
this.websock.send(val)
},
websocketclose (e) {
// 关闭