mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-20 02:34:52 +00:00
feat: share窗口
This commit is contained in:
@@ -5,7 +5,8 @@ import type { InitChatResponse } from './response/chat';
|
||||
/**
|
||||
* 获取一个聊天框的ID
|
||||
*/
|
||||
export const getChatSiteId = (modelId: string) => GET<string>(`/chat/generate?modelId=${modelId}`);
|
||||
export const getChatSiteId = (modelId: string, isShare = false) =>
|
||||
GET<string>(`/chat/generate?modelId=${modelId}&isShare=${isShare ? 'true' : 'false'}`);
|
||||
|
||||
/**
|
||||
* 获取初始化聊天内容
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { getToken } from '../utils/user';
|
||||
interface StreamFetchProps {
|
||||
url: string;
|
||||
data: any;
|
||||
@@ -9,7 +10,8 @@ export const streamFetch = ({ url, data, onMessage }: StreamFetchProps) =>
|
||||
const res = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: getToken() || ''
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
|
Reference in New Issue
Block a user