free-fe-core-modules 0.0.36 → 0.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -366,9 +366,7 @@ export default defineComponent({
366
366
 
367
367
  images_upload_handler: (
368
368
  blobInfo,
369
- success,
370
- failure,
371
- ) => {
369
+ ) => new Promise((resolve, reject) => {
372
370
  const formData = new FormData();
373
371
  formData.append('file', blobInfo.blob(), blobInfo.filename());
374
372
 
@@ -379,18 +377,20 @@ export default defineComponent({
379
377
  },
380
378
  }).then((res) => {
381
379
  if (res && res.data && res.data.id) {
382
- success(`${vm.ctx.config.imageUrlBase}${res.data.id}`);
380
+ resolve(`${vm.ctx.config.imageUrlBase}${res.data.id}`);
383
381
  } else {
384
- failure('上传失败', {
382
+ reject({
383
+ message: '上传失败',
385
384
  remove: true,
386
385
  });
387
386
  }
388
387
  }).catch((err) => {
389
- failure(err, {
388
+ reject({
389
+ message: err,
390
390
  remove: true,
391
391
  });
392
392
  });
393
- },
393
+ }),
394
394
  };
395
395
  },
396
396
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-fe-core-modules",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/freeeis/free-fe-core-modules.git",
6
6
  "author": "zhiquan",