初始化

This commit is contained in:
李琦
2026-01-15 15:37:34 +08:00
parent 8e28549ad5
commit f39e37e534
8 changed files with 681 additions and 169 deletions

View File

@@ -854,3 +854,40 @@ export const deleteTag = async (id: number): Promise<void> => {
throw error
}
}
// 关于页面相关类型
export interface Experience {
year: string
role: string
company: string
}
export interface AboutProfile {
id: number
name: string
avatar: string
location: string
bio: string
email: string
wechat: string
techStack: string[]
experiences: Experience[]
isPrimary: boolean
createdAt: string
updatedAt: string
}
// 关于页面API
export const fetchAboutProfile = async (): Promise<AboutProfile> => {
try {
const response = await fetch(`${API_BASE}/about`)
if (!response.ok) {
const errorData = await response.json()
throw new Error(errorData.error || '获取个人资料失败')
}
return await response.json()
} catch (error) {
console.error('Fetch about profile error:', error)
throw error
}
}