Skip to content

Commit

Permalink
fix(rn): updateFile参数不传formData时报错问题NervJS#13513
Browse files Browse the repository at this point in the history
  • Loading branch information
yechunxi committed May 12, 2023
1 parent 8406092 commit d5df2ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-rn/src/lib/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const createFormData = (filePath, body, name) => {
* @return UploadTask - 一个可以监听上传进度进度变化的事件和取消上传的对象
*/
function uploadFile (opts: Taro.uploadFile.Option): Promise<Taro.uploadFile.SuccessCallbackResult & Taro.UploadTask> {
const { url, timeout = 2000, filePath, name, header, formData, success, fail, complete } = opts
const { url, timeout = 2000, filePath, name, header, formData = {}, success, fail, complete } = opts

const execFetch = fetch(url, {
method: 'POST',
Expand Down

0 comments on commit d5df2ae

Please sign in to comment.