Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
c664c0c9
Commit
c664c0c9
authored
Jul 05, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/chat-support-voice-input' into deploy/dev
parents
660868f8
e599d699
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
base.ts
web/service/base.ts
+5
-11
No files found.
web/service/base.ts
View file @
c664c0c9
...
...
@@ -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
({},
sseB
aseOptions
,
{
const
options
=
Object
.
assign
({},
b
aseOptions
,
{
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment