This commit is contained in:
dzc committed 2025-04-17 09:52:37 +08:00
commit a280748640
8 files changed
+197 -41

No files matched your search

+33 -11
View File
@@ -167,17 +167,39 @@ watch(
return
}
fileList.value = newValue
.split(",")
.map((item: string) => {
const url = item.startsWith("http") ? item : imageBaseUrl + item
return {
name: item.split("/").pop() || "",
url: url,
fileUrl: item,
}
})
.filter((item) => item.url)
if (!newValue.match(/x-oss-process/g)) {
fileList.value = newValue
.split(",")
.map((item: string) => {
const url = item.startsWith("http") ? item : imageBaseUrl + item
return {
name: item.split("/").pop() || "",
url: url,
fileUrl: item,
}
})
.filter((item) => item.url)
console.log("fileList.value", fileList.value)
} else {
fileList.value = newValue
.split("?")
.filter(
(item) =>
item.endsWith(".jpg") || item.endsWith(".png") || item.endsWith(".gif") || item.endsWith(".jpeg") || item.endsWith(".webp"),
)
.map((item: string) => {
const url = item.startsWith("http") ? item : imageBaseUrl + item
return {
name: item.split("/").pop() || "",
url: url,
fileUrl: item,
}
})
.filter((item) => item.url)
console.log("fileList.value", fileList.value)
}
},
{ immediate: true },
)