Browse Source

fix(@vben/plugins): extract URL from response in image upload callback

The upload callback was incorrectly passing the AxiosResponse object
to resolve() instead of extracting the actual image URL string.
This caused the editor to insert [object Object] as image src,
resulting in broken images.
pull/7897/head
yuan.ji 5 months ago
parent
commit
b1d00c06ca
  1. 3
      playground/src/adapter/component/index.ts

3
playground/src/adapter/component/index.ts

@ -734,7 +734,8 @@ async function initComponentAdapter() {
onProgress?.(percent);
},
onSuccess(response) {
resolve(response);
// 从响应中提取图片URL
resolve(response?.data?.url ?? response?.url ?? '');
},
onError() {
reject(new Error($t('ui.tiptap.upload.uploadFailed')));

Loading…
Cancel
Save