上传标签

This commit is contained in:
tianmo committed 2026-10-17 18:22:55 +08:00
1 parent 6494ad2918
commit 832261739f
8 files changed
+120 -20

No files matched your search

+11
View File
@@ -54,8 +54,10 @@ export function useMediaUpload(kind: UploadMediaKind) {
autoCopyMarkdown,
copyFormat,
transcodeToHls,
lastTagIds,
loadPreferences
} = useUploadPreferences(kind)
const { items: tagItems, fetchTags } = useTags()
const uploading = ref(false)
const progressItems = ref<UploadProgressItem[]>([])
@@ -232,6 +234,15 @@ export function useMediaUpload(kind: UploadMediaKind) {
if (kind === 'video' && transcodeToHls.value) {
formData.append('transcode', '1')
}
if (lastTagIds.value.length) {
await fetchTags()
const names = lastTagIds.value
.map(id => tagItems.value.find(tag => tag.id === id)?.name)
.filter((name): name is string => Boolean(name))
if (names.length) {
formData.append('tagNames', JSON.stringify(names))
}
}
progressItems.value = progressItems.value.map(item => ({
...item,