fix: When uploading files during application dialogue, there are special whitespace characters and file name parsing errors #2738 (#2746)
This commit is contained in:
parent
165c27164e
commit
36809b3314
@ -392,28 +392,36 @@ const uploadFile = async (file: any, fileList: any) => {
|
|||||||
.then((response) => {
|
.then((response) => {
|
||||||
fileList.splice(0, fileList.length)
|
fileList.splice(0, fileList.length)
|
||||||
uploadImageList.value.forEach((file: any) => {
|
uploadImageList.value.forEach((file: any) => {
|
||||||
const f = response.data.filter((f: any) => f.name === file.name)
|
const f = response.data.filter(
|
||||||
|
(f: any) => f.name.replaceAll(' ', '') === file.name.replaceAll(' ', '')
|
||||||
|
)
|
||||||
if (f.length > 0) {
|
if (f.length > 0) {
|
||||||
file.url = f[0].url
|
file.url = f[0].url
|
||||||
file.file_id = f[0].file_id
|
file.file_id = f[0].file_id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
uploadDocumentList.value.forEach((file: any) => {
|
uploadDocumentList.value.forEach((file: any) => {
|
||||||
const f = response.data.filter((f: any) => f.name === file.name)
|
const f = response.data.filter(
|
||||||
|
(f: any) => f.name.replaceAll(' ', '') == file.name.replaceAll(' ', '')
|
||||||
|
)
|
||||||
if (f.length > 0) {
|
if (f.length > 0) {
|
||||||
file.url = f[0].url
|
file.url = f[0].url
|
||||||
file.file_id = f[0].file_id
|
file.file_id = f[0].file_id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
uploadAudioList.value.forEach((file: any) => {
|
uploadAudioList.value.forEach((file: any) => {
|
||||||
const f = response.data.filter((f: any) => f.name === file.name)
|
const f = response.data.filter(
|
||||||
|
(f: any) => f.name.replaceAll(' ', '') === file.name.replaceAll(' ', '')
|
||||||
|
)
|
||||||
if (f.length > 0) {
|
if (f.length > 0) {
|
||||||
file.url = f[0].url
|
file.url = f[0].url
|
||||||
file.file_id = f[0].file_id
|
file.file_id = f[0].file_id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
uploadVideoList.value.forEach((file: any) => {
|
uploadVideoList.value.forEach((file: any) => {
|
||||||
const f = response.data.filter((f: any) => f.name === file.name)
|
const f = response.data.filter(
|
||||||
|
(f: any) => f.name.replaceAll(' ', '') === file.name.replaceAll(' ', '')
|
||||||
|
)
|
||||||
if (f.length > 0) {
|
if (f.length > 0) {
|
||||||
file.url = f[0].url
|
file.url = f[0].url
|
||||||
file.file_id = f[0].file_id
|
file.file_id = f[0].file_id
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user