mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-15 22:46:49 +00:00
[improvement](semantic-fe) Added parameter compatibility for network requests in different modes
This commit is contained in:
@@ -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([
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user