修复公告模块的TypeScript错误和API调用
- 使用 apiClient 替换不存在的 apiRequest - 修复可能为 undefined 的对象访问 - 添加可选链操作符和默认值 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -68,11 +68,11 @@ function getCategoryLabel(category: string) {
|
||||
size="small"
|
||||
class="category-tag"
|
||||
:style="{
|
||||
borderColor: getCategoryInfo(announcement.category).color,
|
||||
color: getCategoryInfo(announcement.category).color
|
||||
borderColor: getCategoryInfo(announcement.category)?.color || '#94a3b8',
|
||||
color: getCategoryInfo(announcement.category)?.color || '#94a3b8'
|
||||
}"
|
||||
>
|
||||
<el-icon><component :is="getCategoryInfo(announcement.category).icon" /></el-icon>
|
||||
<el-icon><component :is="getCategoryInfo(announcement.category)?.icon || Bell" /></el-icon>
|
||||
{{ getCategoryLabel(announcement.category) }}
|
||||
</el-tag>
|
||||
<el-tag v-if="announcement.is_pinned" type="warning" effect="plain" size="small">置顶</el-tag>
|
||||
|
||||
Reference in New Issue
Block a user