fix(profile): photo upload no longer wipes saved info; mobile layout polish for profile and resume

This commit is contained in:
root
2026-10-17 13:43:09 +08:00
parent 78bfe188b6
commit 6a97590f90
19 changed files with 71 additions and 70 deletions
+4 -3
View File
@@ -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 (
<div className="mx-auto max-w-[880px] px-3 py-4 sm:px-6 sm:py-5">
<div className="mb-4 flex items-center justify-between">
<div className="mb-4 flex flex-wrap items-center justify-between gap-2">
<h2 className="text-[15px] font-semibold text-ink-1">个人信息</h2>
<Button variant="primary" onClick={openEdit}><Pencil size={13} /> 编辑</Button>
</div>