From c0ac9ccfe6562324b1947923b52a3ea33fcce540 Mon Sep 17 00:00:00 2001 From: jmal Date: Thu, 4 Feb 2021 11:09:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E4=B8=AD=E5=9B=BE=E7=89=87=E5=9C=B0=E5=9D=80=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E7=9A=84=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FancyTree/index.vue | 2 +- src/components/input/UploadImageInput.vue | 2 +- src/utils/file-config.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/FancyTree/index.vue b/src/components/FancyTree/index.vue index 62d825f..0570970 100644 --- a/src/components/FancyTree/index.vue +++ b/src/components/FancyTree/index.vue @@ -459,7 +459,7 @@ if(file.contentType.indexOf('video') > -1){ return 'video' } - if(file.contentType.indexOf('image') > -1){ + if(file.contentType.contentType.startsWith('image')){ return 'image' } if(file.contentType.indexOf('audio') > -1){ diff --git a/src/components/input/UploadImageInput.vue b/src/components/input/UploadImageInput.vue index a071c5d..6ff7de1 100644 --- a/src/components/input/UploadImageInput.vue +++ b/src/components/input/UploadImageInput.vue @@ -156,7 +156,7 @@ export default { this.fileList = fileList }, format(filepath){ - this.currentValue = window.location.origin + fileConfig.mardownPreviewUrl(filepath) + this.currentValue = fileConfig.mardownPreviewUrl(filepath) this.change(this.currentValue) }, // url转blob diff --git a/src/utils/file-config.js b/src/utils/file-config.js index 75512d9..b1a807a 100644 --- a/src/utils/file-config.js +++ b/src/utils/file-config.js @@ -7,7 +7,7 @@ export default { return `${this.baseUrl}/file/${username}${file.path}${file.name}` }, mardownPreviewUrl: function (path){ - return `${this.baseUrl}${path}` + return window.location.origin + `${this.baseUrl}${path}` }, publicPreviewUrl: function(fileIds) { return `${this.baseUrl}/public/preview/${fileIds}`