mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-24 10:27:28 +08:00
[improvement](webapp) change rollup terser package
This commit is contained in:
@@ -64,7 +64,7 @@
|
||||
"@antv/layout": "^0.3.20",
|
||||
"@antv/xflow": "^1.0.55",
|
||||
"@babel/runtime": "^7.22.5",
|
||||
"supersonic-chat-sdk": "^0.1.6",
|
||||
"supersonic-chat-sdk": "^0.1.0",
|
||||
"@types/numeral": "^2.0.2",
|
||||
"@types/react-draft-wysiwyg": "^1.13.2",
|
||||
"@types/react-syntax-highlighter": "^13.5.0",
|
||||
@@ -137,7 +137,7 @@
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
"node": ">=10.0.0 <17.0.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"@types/react": "17.0.0"
|
||||
|
||||
@@ -12,8 +12,6 @@ import defaultSettings from '../config/defaultSettings';
|
||||
import settings from '../config/themeSettings';
|
||||
import { deleteUrlQuery } from './utils/utils';
|
||||
import { AUTH_TOKEN_KEY, FROM_URL_KEY } from '@/common/constants';
|
||||
import 'supersonic-chat-sdk/dist/index.css';
|
||||
import { setToken as setChatSdkToken } from 'supersonic-chat-sdk';
|
||||
export { request } from './services/request';
|
||||
import { ROUTE_AUTH_CODES } from '../config/routes';
|
||||
|
||||
@@ -98,8 +96,6 @@ export async function getInitialState(): Promise<{
|
||||
await getToken();
|
||||
}
|
||||
|
||||
setChatSdkToken(localStorage.getItem(AUTH_TOKEN_KEY) || '');
|
||||
|
||||
const currentUser = await fetchUserInfo();
|
||||
|
||||
if (currentUser) {
|
||||
|
||||
@@ -10,9 +10,11 @@ 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 { AUTH_TOKEN_KEY, DEFAULT_CONVERSATION_NAME, WEB_TITLE } from '@/common/constants';
|
||||
import { HistoryMsgItemType, MsgDataType, getHistoryMsg, queryContext } from 'supersonic-chat-sdk';
|
||||
import { getConversationContext } from './utils';
|
||||
import { setToken as setChatSdkToken } from 'supersonic-chat-sdk';
|
||||
import 'supersonic-chat-sdk/dist/index.css';
|
||||
|
||||
const Chat = () => {
|
||||
const [messageList, setMessageList] = useState<MessageItem[]>([]);
|
||||
@@ -27,6 +29,10 @@ const Chat = () => {
|
||||
const conversationRef = useRef<any>();
|
||||
const chatFooterRef = useRef<any>();
|
||||
|
||||
useEffect(() => {
|
||||
setChatSdkToken(localStorage.getItem(AUTH_TOKEN_KEY) || '');
|
||||
}, []);
|
||||
|
||||
const sendHelloRsp = () => {
|
||||
setMessageList([
|
||||
{
|
||||
|
||||
@@ -12,7 +12,6 @@ import { postUserLogin, userRegister } from './services';
|
||||
import { AUTH_TOKEN_KEY } from '@/common/constants';
|
||||
import { queryCurrentUser } from '@/services/user';
|
||||
import { history, useModel } from 'umi';
|
||||
// import { setToken as setChatSdkToken } from 'supersonic-chat-sdk';
|
||||
|
||||
const { Item } = Form;
|
||||
const LoginPage: React.FC = () => {
|
||||
@@ -25,7 +24,6 @@ const LoginPage: React.FC = () => {
|
||||
const { code, data, msg } = await postUserLogin(values);
|
||||
if (code === 200) {
|
||||
localStorage.setItem(AUTH_TOKEN_KEY, data);
|
||||
// setChatSdkToken(data || '');
|
||||
const { code: queryUserCode, data: queryUserData } = await queryCurrentUser();
|
||||
if (queryUserCode === 200) {
|
||||
const currentUser = {
|
||||
|
||||
Reference in New Issue
Block a user