修复文件选取问题

This commit is contained in:
WindowBird 2025-11-17 17:22:57 +08:00
parent 023f8f94b2
commit e8ca86e899

View File

@ -72,12 +72,12 @@ const handleChooseFiles = async () => {
}
try {
// #ifdef H5 || MP-WEIXIN || APP-PLUS
await chooseFilesWithUni(remainingCount);
// #ifdef APP-PLUS
await chooseFilesNative(remainingCount);
// #endif
// #ifndef H5 || MP-WEIXIN || APP-PLUS
await chooseFilesNative(remainingCount);
// #ifndef APP-PLUS
await chooseFilesWithUni(remainingCount);
// #endif
} catch (error) {
console.error('选择文件失败:', error);
@ -104,13 +104,8 @@ const chooseFilesWithUni = (remainingCount) => {
reject(error);
}
},
fail: async () => {
try {
await chooseFilesNative(remainingCount);
resolve();
} catch (nativeError) {
reject(nativeError);
}
fail: () => {
reject(new Error('文件选择被取消或失败'));
}
});
});