初始化
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user