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}`