【功能修复】修复真机环境下的图片上传问题

This commit is contained in:
卢越
2024-10-28 17:04:57 +08:00
parent 113aead37b
commit e9b9ac1f7a
3 changed files with 57 additions and 51 deletions
+2 -3
View File
@@ -17,12 +17,11 @@ export const get_file_ext = (name) => {
*/
export const get_extname = (fileExtname) => {
if (!Array.isArray(fileExtname)) {
let extname = fileExtname.replace(/(\[|\])/g, '');
let extname = fileExtname.replace(/([\[\]])/g, '');
return extname.split(',');
} else {
return fileExtname;
}
return [];
};
/**
@@ -91,7 +90,7 @@ export const get_file_data = async (files, type = 'image') => {
extname: extname || '',
cloudPath: files.cloudPath,
fileType: files.fileType,
url: files.path || files.path,
url: files.url || files.path,
size: files.size, //单位是字节
image: {},
path: files.path,