feat: sse连接,处理流式渲染

This commit is contained in:
rd
2025-08-23 11:53:27 +08:00
parent 063ce3df5e
commit 75874d88dc
6 changed files with 179 additions and 91 deletions

View File

@ -24,9 +24,8 @@ export const deleteHistoryItem = (id: string) => {
};
export const baseUrl = 'http://192.168.40.41:8001';
const getHeaders = () => {
export const getHeaders = () => {
const store = useEnterpriseStore();
return {
Authorization: glsWithCatch('accessToken'),
@ -46,17 +45,6 @@ export const getAgentInfo = async () => {
return data;
};
/**
* 指令输入
*/
export const getInputAgent = async (params: {}) => {
const { data } = await axios.get(`${baseUrl}/api/agent/input`, {
params,
headers: { ...getHeaders(), Accept: 'text/event-stream' },
});
return data;
};
/**
* 生成会话id
*/