Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions apps/web/src/components/editor/editor-header/PostInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const allowPost = computed(() => extensionInstalled.value && allAccounts.value.s
const platformCategories = [
{
name: `媒体平台`,
platforms: [`wechat`, `toutiao`, `zhihu`, `baijiahao`, `wangyihao`, `sohu`, `weibo`, `bilibili`, `sspai`, `twitter`, `douyin`, `xiaohongshu`],
platforms: [`wechat`, `toutiao`, `zhihu`, `baijiahao`, `wangyihao`, `sohu`, `weibo`, `bilibili`, `sspai`, `twitter`, `douyin`, `xiaohongshu`, `douban`],
},
{
name: `博客平台`,
Expand Down Expand Up @@ -268,10 +268,18 @@ function getPlatformUrl(type: string): string {
douyin: 'https://creator.douyin.com/creator-micro/content/post/article?default-tab=5&enter_from=publish_page&media_type=article&type=new',
xiaohongshu: 'https://creator.xiaohongshu.com/publish/publish?from=menu&target=article',
elecfans: 'https://www.elecfans.com/d/article/md/',
douban: 'https://www.douban.com/note/create',
}
return urls[type] || '#'
}

function onAvatarError(account: PostAccount, event: Event) {
const img = event.target as HTMLImageElement
if (!account)
return
img.style.display = 'none'
}

function checkExtension() {
if (window.$cose !== undefined) {
extensionInstalled.value = true
Expand Down Expand Up @@ -415,8 +423,7 @@ onBeforeMount(() => {
:src="account.avatar"
alt=""
class="ml-1 h-4 w-4 rounded-full object-cover"
crossorigin="anonymous"
@error="(e: Event) => (e.target as HTMLImageElement).style.display = 'none'"
@error="onAvatarError(account, $event)"
>
<span class="text-sm text-muted-foreground">@{{ account.displayName }}</span>
</template>
Expand Down