[improvement](semantic-fe) Added parameter compatibility for network requests in different modes

This commit is contained in:
tristanliu
2023-06-21 11:10:07 +08:00
parent 693fc03c6f
commit 9c9d7382fe
12 changed files with 42 additions and 42 deletions

View File

@@ -10,9 +10,16 @@ import Conversation from './Conversation';
import RightSection from './RightSection';
import ChatFooter from './ChatFooter';
import classNames from 'classnames';
import { DEFAULT_CONVERSATION_NAME, WEB_TITLE } from '@/common/constants';
import { HistoryMsgItemType, MsgDataType, getHistoryMsg, queryContext } from 'supersonic-chat-sdk';
import { AUTH_TOKEN_KEY, DEFAULT_CONVERSATION_NAME, WEB_TITLE } from '@/common/constants';
import {
HistoryMsgItemType,
MsgDataType,
getHistoryMsg,
queryContext,
setToken as setChatSdkToken,
} from 'supersonic-chat-sdk';
import { getConversationContext } from './utils';
import 'supersonic-chat-sdk/dist/index.css';
const Chat = () => {
const [messageList, setMessageList] = useState<MessageItem[]>([]);
@@ -27,6 +34,10 @@ const Chat = () => {
const conversationRef = useRef<any>();
const chatFooterRef = useRef<any>();
useEffect(() => {
setChatSdkToken(localStorage.getItem(AUTH_TOKEN_KEY) || '');
}, []);
const sendHelloRsp = () => {
setMessageList([
{