修复合伙人端上传门头照片失败的问题

This commit is contained in:
2026-07-12 15:55:49 +08:00
parent 9fc955d81f
commit 2c04676555
8 changed files with 43 additions and 37 deletions
@@ -117,10 +117,16 @@ export default function OssUploadField({
setAuthorizing(true);
setError('');
try {
await authorizePartnerWechat();
const result = await authorizePartnerWechat();
if (result) {
const me = await fetchPartnerProfile();
setProfile(me);
onWechatReadyChange?.(!!me.hasWechat);
}
} catch (e) {
const text = e instanceof Error ? e.message : '微信授权失败';
showUploadError(text);
} finally {
setAuthorizing(false);
}
}
@@ -139,9 +145,11 @@ export default function OssUploadField({
count: 1,
sourceType: ['album', 'camera'],
});
if (!files?.[0]) {
throw new Error('未能获取图片,请重试');
if (!files) {
openNativeFilePicker();
return;
}
if (!files[0]) return;
await uploadSelectedFile(files[0]);
});
} finally {