@zero-library/chat-agent 2.1.1 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -649,7 +649,7 @@ function createChatStore() {
649
649
  const resolveConversationId = async (receiverId, strategy = 2) => {
650
650
  if (strategy === 1) {
651
651
  const { data } = await conversationRecentQuery({
652
- receiverId: String(receiverId),
652
+ receiverId,
653
653
  receiverType: 3,
654
654
  businessId: config.params.businessId,
655
655
  businessType: config.params.businessType
@@ -657,7 +657,7 @@ function createChatStore() {
657
657
  return data;
658
658
  } else {
659
659
  const { data } = await conversationCreate({
660
- receiverId: String(receiverId),
660
+ receiverId,
661
661
  receiverType: 3,
662
662
  businessId: config.params.businessId,
663
663
  businessType: config.params.businessType,
@@ -731,6 +731,7 @@ function createChatStore() {
731
731
  } finally {
732
732
  }
733
733
  config.hooks?.onAfterInitMessages?.(conversation.messages[conversationId].message);
734
+ config.hooks?.onAfterInit?.();
734
735
  }
735
736
  };
736
737
  const pickReceiver = () => {
@@ -790,6 +791,7 @@ function createChatStore() {
790
791
  }
791
792
  };
792
793
  const cancelReceive = async () => {
794
+ console.log("\u53D6\u6D88\u63A5\u6536");
793
795
  await conversationStop(conversation.active.id);
794
796
  };
795
797
  const updateConversationTitle = (conversationId, title) => {
@@ -1820,7 +1822,7 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
1820
1822
  return;
1821
1823
  }
1822
1824
  if (config?.receiverId && config?.receiverType === 3) {
1823
- chatStore.switchAgentConversation(config.receiverId, config.conversationStrategy);
1825
+ chatStore.switchAgentConversation(String(config.receiverId), config.conversationStrategy);
1824
1826
  }
1825
1827
  }, [config]);
1826
1828
  useEffect(() => {
@@ -1865,7 +1867,7 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
1865
1867
  }
1866
1868
  }, [hasPreView]);
1867
1869
  useWebSocket({
1868
- url: getWebSocketUrl(`/lolr/conversation/ws/subscribe?NS-TOKEN=${getToken()}`, isLocalhost() ? "192.168.6.23:9090" : ""),
1870
+ url: getWebSocketUrl(`/api/lolr/conversation/ws/subscribe?NS-TOKEN=${getToken()}`, isLocalhost() ? "192.168.6.23" : ""),
1869
1871
  onMessage: chatStore.acceptMessage,
1870
1872
  clientHeartbeat: false,
1871
1873
  reconnectInterval: 1e4