diff --git a/app/src/pages/profile/ProfilePage.tsx b/app/src/pages/profile/ProfilePage.tsx index ba0e2c8..ca4248a 100644 --- a/app/src/pages/profile/ProfilePage.tsx +++ b/app/src/pages/profile/ProfilePage.tsx @@ -65,9 +65,10 @@ export function ProfilePage() { setPhotoBusy(true); try { const url = await profilePhotoUpload(f); - const next = { ...EMPTY, ...form, photoUrl: url }; - setForm(next); + // 以已保存档案为底,只更新 photoUrl —— 避免覆盖其他字段 + const next = { ...EMPTY, ...info, photoUrl: url }; await profileUpsert({ info: next }); + setForm(prev => ({ ...EMPTY, ...prev, photoUrl: url })); void qc.invalidateQueries({ queryKey: ['profile'] }); toast('success', '证件照已上传'); } catch (e) { toast('error', (e as Error).message); } @@ -78,7 +79,7 @@ export function ProfilePage() { return (
'+w(l.name||"个人简历")+" "+(c?''+c+" ":"")+(S?''+S+" ":"")+" | "+d+"
| '+w(p.title)+' | '+w(p.date??"")+" |
| '+w(C[0])+' | '+w(C[1])+" |
| '+w(C[0])+' | '+w(C[1])+" | "+(I%2===1?"
'+w(p.text??"").replace(/\n/g,"
")+"
'+w(l.name||"个人简历")+" "+(c?''+c+" ":"")+(S?''+S+" ":"")+" | "+d+"
| '+w(p.title)+' | '+w(p.date??"")+" |
| '+w(C[0])+' | '+w(C[1])+" |
| '+w(C[0])+' | '+w(C[1])+" | "+(I%2===1?"
'+w(p.text??"").replace(/\n/g,"
")+"