|
|
@@ -1,10 +1,13 @@
|
|
|
import request from "../request";
|
|
|
const create = (token, agentId, dialogId, type) => {
|
|
|
+ const socket_url = window.WEBSOCKET_BASE_URL;
|
|
|
+
|
|
|
const wsParam = type === "report" ? "report" : "chat";
|
|
|
const wsUrl =
|
|
|
type === "excel"
|
|
|
- ? `ws://${location.host}/api/document/ws/excel`
|
|
|
- : `ws://${location.host}/api/${wsParam}/ws/${agentId}/${dialogId}?token=${token}`;
|
|
|
+ ? `ws://${socket_url}/api/document/ws/excel`
|
|
|
+ : `ws://${socket_url}/api/${wsParam}/ws/${agentId}/${dialogId}?token=${token}`;
|
|
|
+
|
|
|
const ws = new WebSocket(wsUrl);
|
|
|
// 当 WebSocket 打开时...
|
|
|
ws.onopen = function (event) {
|