mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
802847649c
commit
068c77da74
@ -65,6 +65,10 @@ class BookSourceDebugWebSocket(handshakeRequest: NanoHTTPD.IHTTPSession) :
|
|||||||
Debug.callback = this@BookSourceDebugWebSocket
|
Debug.callback = this@BookSourceDebugWebSocket
|
||||||
Debug.startDebug(this, it, key)
|
Debug.startDebug(this, it, key)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
send("数据必须为Json格式")
|
||||||
|
close(NanoWSD.WebSocketFrame.CloseCode.NormalClosure, "调试结束", false)
|
||||||
|
return@launch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ const debug = (
|
|||||||
const socket = new WebSocket(url);
|
const socket = new WebSocket(url);
|
||||||
|
|
||||||
socket.onopen = () => {
|
socket.onopen = () => {
|
||||||
socket.send(`{"tag":"${sourceUrl}", "key":"${searchKey}"}`);
|
socket.send(JSON.stringify({ tag: sourceUrl, key: searchKey }));
|
||||||
};
|
};
|
||||||
socket.onmessage = ({ data }) => onReceive(data);
|
socket.onmessage = ({ data }) => onReceive(data);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user