diff --git a/dashboard/src/components/extension/PinnedPluginItem.vue b/dashboard/src/components/extension/PinnedPluginItem.vue index 8fbb7dfd0b..f836b1134d 100644 --- a/dashboard/src/components/extension/PinnedPluginItem.vue +++ b/dashboard/src/components/extension/PinnedPluginItem.vue @@ -39,6 +39,16 @@ const emit = defineEmits([ const handlePinnedImgError = (e) => { e.target.src = defaultPluginIcon; }; + +const authorDisplay = computed(() => { + const p = props.plugin || {}; + if (typeof p.author === 'string' && p.author.trim()) return p.author; + if (Array.isArray(p.authors) && p.authors.length) return p.authors.join(', '); + if (typeof p.author_name === 'string' && p.author_name.trim()) return p.author_name; + if (typeof p.owner === 'string' && p.owner.trim()) return p.owner; + if (p.author && typeof p.author === 'object' && p.author.name) return p.author.name; + return ''; +}); @@ -70,6 +80,22 @@ const handlePinnedImgError = (e) => { + + + + + + + {{ plugin.display_name || plugin.name }} + {{ authorDisplay || (plugin.author || '') }} + + + + diff --git a/dashboard/src/components/shared/ExtensionCard.vue b/dashboard/src/components/shared/ExtensionCard.vue index 1e37314fdf..061a76c56f 100644 --- a/dashboard/src/components/shared/ExtensionCard.vue +++ b/dashboard/src/components/shared/ExtensionCard.vue @@ -68,6 +68,17 @@ const astrbotVersionRequirement = computed(() => { : ""; }); +// 作者显示(兼容多种字段名) +const authorDisplay = computed(() => { + const ext = props.extension || {}; + if (typeof ext.author === 'string' && ext.author.trim()) return ext.author; + if (Array.isArray(ext.authors) && ext.authors.length) return ext.authors.join(', '); + if (typeof ext.author_name === 'string' && ext.author_name.trim()) return ext.author_name; + if (typeof ext.owner === 'string' && ext.owner.trim()) return ext.owner; + if (ext.author && typeof ext.author === 'object' && ext.author.name) return ext.author.name; + return ''; +}); + const logoLoadFailed = ref(false); const logoSrc = computed(() => { @@ -345,6 +356,10 @@ const viewChangelog = () => { {{ tag === "danger" ? tm("tags.danger") : tag }} + + + {{ authorDisplay }} +