Sfoglia il codice sorgente

在sdk方法中解析数据,传出数据对象数组

HuangKai 1 settimana fa
parent
commit
c620f24dcf
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/view/utils/connectTestTool.js

+ 1 - 1
src/view/utils/connectTestTool.js

@@ -10,7 +10,7 @@ export default function connectTestTool(url) {
 class TestToolSocket {
 	constructor(url){
 		this._socket = new WebSocket(url);
-		this._socket.onmessage = (e) => this.onRecieveMessage(e);
+		this._socket.onmessage = (e) => this.onRecieveMessage(JSON.parse(e.data).data);
 		this._socket.onclose = (e) => this.onClose(e);
 		this._socket.onerror = (e) => this.onError(e);
 		// this._socket.onopen = (e) => this.onOpen(e);