Browse Source

fix: webapp upload file (#10195)

tags/0.11.0
zxhlyh 1 year ago
parent
commit
dfa3ef0564
No account linked to committer's email address
2 changed files with 3 additions and 3 deletions
  1. 1
    1
      web/app/components/base/file-uploader/hooks.ts
  2. 2
    2
      web/service/common.ts

+ 1
- 1
web/app/components/base/file-uploader/hooks.ts View File

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,

+ 2
- 2
web/service/common.ts View File

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) => {
return post<{ id: string; name: string; size: number; mime_type: string; url: string }>('/remote-files/upload', { body: { url } })
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 } }, { isPublicAPI: isPublic })
} }


export const sendEMailLoginCode = (email: string, language = 'en-US') => export const sendEMailLoginCode = (email: string, language = 'en-US') =>

Loading…
Cancel
Save