Bladeren bron

回显图片

zhengnaiwen_citu 3 maanden geleden
bovenliggende
commit
645ae76ff9

+ 2 - 2
src/api/dataOrigin.js

@@ -49,6 +49,6 @@ export function updateBusinessCardStatus (data, id) {
 }
 
 // 非结构化数据源 获取名片图片
-export function getBusinessCardImage (path) {
-  return http.download(`/parse/business-cards/image/${path}`, undefined, 'get')
+export function getBusinessCardImage (param) {
+  return http.download('/parse/business-cards/image', param, 'get')
 }

+ 4 - 6
src/views/dataOrigin/unstructuredData/manualCollection/components/imageImportEdit.vue

@@ -208,13 +208,11 @@ export default {
       }
       // this.file = item.image_path
       try {
-        const { data, name } = await getBusinessCardImage(item.image_path)
-        // const type = item.image_path.split('.').pop()
-        this.file = new File([data], name ?? item.image_path, { type: data.type })
-        // handleReadFile(data, type, files => {
-        //   // 返回blob
+        const { data } = await getBusinessCardImage({
+          path: item.image_path
+        })
+        this.file = new File([data], item.image_path, { type: data.type })
         this.previewUrl = URL.createObjectURL(data)
-        // })
       } catch (error) {
         this.$snackbar.error(error)
       }