mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 03:58:14 +00:00
[feature](chat-sdk) optimize
This commit is contained in:
@@ -86,13 +86,13 @@ const ChatItem: React.FC<Props> = ({
|
||||
const onSendMsg = async () => {
|
||||
setLoading(true);
|
||||
const semanticRes = await chatQuery(msg, conversationId, classId);
|
||||
const semanticValid = updateData(semanticRes.data);
|
||||
if (suggestionEnable && semanticValid) {
|
||||
const semanticResData = semanticRes.data.data;
|
||||
await getSuggestions(semanticResData.entityInfo?.domainInfo?.itemId, semanticRes.data.data);
|
||||
} else {
|
||||
setSuggestionData(undefined);
|
||||
}
|
||||
updateData(semanticRes.data);
|
||||
// if (suggestionEnable && semanticValid) {
|
||||
// const semanticResData = semanticRes.data.data;
|
||||
// await getSuggestions(semanticResData.entityInfo?.domainInfo?.itemId, semanticRes.data.data);
|
||||
// } else {
|
||||
// setSuggestionData(undefined);
|
||||
// }
|
||||
if (onLastMsgDataLoaded) {
|
||||
onLastMsgDataLoaded(semanticRes.data.data);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import axios from './axiosInstance';
|
||||
import { ChatContextType, HistoryType, MsgDataType, SearchRecommendItem } from '../common/type';
|
||||
import { QueryDataType } from '../common/type';
|
||||
|
||||
const DEFAULT_CHAT_ID = 0;
|
||||
const DEFAULT_CHAT_ID = 2;
|
||||
|
||||
const prefix = '/api';
|
||||
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
const { createProxyMiddleware } = require('http-proxy-middleware');
|
||||
|
||||
module.exports = function(app) {
|
||||
// app.use(
|
||||
// '/api',
|
||||
// createProxyMiddleware({
|
||||
// target: 'http://10.91.206.71:9079',
|
||||
// changeOrigin: true,
|
||||
// })
|
||||
// );
|
||||
app.use(
|
||||
'/api',
|
||||
// '/api',
|
||||
createProxyMiddleware({
|
||||
target: 'http://supersonic.test.tmeoa.com',
|
||||
target: 'http://localhost:9080',
|
||||
changeOrigin: true,
|
||||
})
|
||||
);
|
||||
|
||||
@@ -160,13 +160,6 @@ export function getChartLightenColor(col) {
|
||||
export const isMobile = window.navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i);
|
||||
|
||||
|
||||
export function isProd() {
|
||||
return (
|
||||
window.location.origin.includes('tmeoa.com') ||
|
||||
window.location.hostname === 's2.tencentmusic.com'
|
||||
);
|
||||
}
|
||||
|
||||
export function setToken(token: string) {
|
||||
localStorage.setItem('SUPERSONIC_CHAT_TOKEN', token);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user