Commit c664c0c9 authored by StyleZhang's avatar StyleZhang

Merge branch 'feat/chat-support-voice-input' into deploy/dev

parents 660868f8 e599d699
......@@ -22,16 +22,6 @@ const baseOptions = {
redirect: 'follow',
}
const sseBaseOptions = {
method: 'GET',
mode: 'cors',
credentials: 'include', // always send cookies、HTTP Basic authentication.
headers: new Headers({
'Content-Type': ContentType.json,
}),
redirect: 'follow',
}
export type IOnDataMoreInfo = {
conversationId?: string
taskId?: string
......@@ -311,11 +301,15 @@ export const upload = (options: any): Promise<any> => {
export const ssePost = (url: string, fetchOptions: any, { isPublicAPI = false, onData, onCompleted, onError, getAbortController }: IOtherOptions) => {
const abortController = new AbortController()
const options = Object.assign({}, sseBaseOptions, {
const options = Object.assign({}, baseOptions, {
method: 'POST',
signal: abortController.signal,
}, fetchOptions)
const contentType = options.headers.get('Content-Type')
if (!contentType)
options.headers.set('Content-Type', ContentType.json)
getAbortController?.(abortController)
const urlPrefix = isPublicAPI ? PUBLIC_API_PREFIX : API_PREFIX
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment