Skip to content

Commit

Permalink
fix(h5): chooseFile extension 默认值错误导致选择文件时没有类型筛选
Browse files Browse the repository at this point in the history
  • Loading branch information
StrivingRabbit committed Jan 15, 2025
1 parent 9706a76 commit fffeeb0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/uni-api/src/protocols/media/chooseFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ export const ChooseFileOptions: ApiOptions<API_TYPE_CHOOSE_FILE> = {
if (extension instanceof Array && extension.length === 0) {
return 'param extension should not be empty.'
}
if (!extension) params.extension = ['*']
if (!extension) {
if (params.type === 'all' || !params.type) {
params.extension = ['']
} else {
params.extension = ['*']
}
}
},
},
}
Expand Down

0 comments on commit fffeeb0

Please sign in to comment.