mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
fix: webapp upload file (#10195)
This commit is contained in:
parent
0066531266
commit
dfa3ef0564
|
@ -216,7 +216,7 @@ export const useFile = (fileConfig: FileUpload) => {
|
||||||
handleAddFile(uploadingFile)
|
handleAddFile(uploadingFile)
|
||||||
startProgressTimer(uploadingFile.id)
|
startProgressTimer(uploadingFile.id)
|
||||||
|
|
||||||
uploadRemoteFileInfo(url).then((res) => {
|
uploadRemoteFileInfo(url, !!params.token).then((res) => {
|
||||||
const newFile = {
|
const newFile = {
|
||||||
...uploadingFile,
|
...uploadingFile,
|
||||||
type: res.mime_type,
|
type: res.mime_type,
|
||||||
|
|
|
@ -324,8 +324,8 @@ export const verifyForgotPasswordToken: Fetcher<CommonResponse & { is_valid: boo
|
||||||
export const changePasswordWithToken: Fetcher<CommonResponse, { url: string; body: { token: string; new_password: string; password_confirm: string } }> = ({ url, body }) =>
|
export const changePasswordWithToken: Fetcher<CommonResponse, { url: string; body: { token: string; new_password: string; password_confirm: string } }> = ({ url, body }) =>
|
||||||
post<CommonResponse>(url, { body })
|
post<CommonResponse>(url, { body })
|
||||||
|
|
||||||
export const uploadRemoteFileInfo = (url: string) => {
|
export const uploadRemoteFileInfo = (url: string, isPublic?: boolean) => {
|
||||||
return post<{ id: string; name: string; size: number; mime_type: string; url: string }>('/remote-files/upload', { body: { url } })
|
return post<{ id: string; name: string; size: number; mime_type: string; url: string }>('/remote-files/upload', { body: { url } }, { isPublicAPI: isPublic })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const sendEMailLoginCode = (email: string, language = 'en-US') =>
|
export const sendEMailLoginCode = (email: string, language = 'en-US') =>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user