|
|
@@ -781,17 +781,13 @@ export async function uploadFromSelect(
|
|
|
|
|
|
if (isMiniProgram) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- if (typeof Taro === 'undefined') {
|
|
|
- reject(new Error('Taro 环境未找到'));
|
|
|
- return;
|
|
|
- }
|
|
|
|
|
|
Taro.chooseImage({
|
|
|
count,
|
|
|
sourceType: sourceType as any, // 确保类型兼容
|
|
|
success: async (res) => {
|
|
|
const tempFilePath = res.tempFilePaths[0];
|
|
|
- const fileName = res.tempFiles[0]?.name || tempFilePath.split('/').pop() || 'unnamed-file';
|
|
|
+ const fileName = res.tempFiles[0]?.originalFileObj?.name || tempFilePath.split('/').pop() || 'unnamed-file';
|
|
|
|
|
|
try {
|
|
|
const result = await uploadMinIOWithPolicy(uploadPath, tempFilePath, fileName, callbacks);
|