修复合伙人端上传门头照片失败的问题
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user