diff --git a/src/component/HomePage/ExportModel.vue b/src/component/HomePage/ExportModel.vue index f480f701..53b8b55a 100644 --- a/src/component/HomePage/ExportModel.vue +++ b/src/component/HomePage/ExportModel.vue @@ -754,9 +754,11 @@ export default defineComponent({ } if(key == 'upImgFiles')imgWidth[key] = setImageWidth(key,img); - let url = imgUrl.split('?')[0] - var match = url.match(/^(?:https?:\/\/[^\/]+)\/(.*)/); - minioUrl = match[1] + // let url = imgUrl.split('?')[0] + // var match = url.match(/^(?:https?:\/\/[^\/]+)\/(.*)/); + const { pathname } = new URL(imgUrl); + const result = pathname.slice(1); + minioUrl = result // let id = let proportion = img.height / img.width; //计算图形宽高比例 // let imgWidth = setImageWidth(key) diff --git a/src/component/modules/generalCanvas.vue b/src/component/modules/generalCanvas.vue index 447baae4..6be36532 100644 --- a/src/component/modules/generalCanvas.vue +++ b/src/component/modules/generalCanvas.vue @@ -295,9 +295,12 @@ export default defineComponent({ imgWidth[key] = setImageWidth(key,img); } - let url = imgUrl.split('?')[0] - var match = url.match(/^(?:https?:\/\/[^\/]+)\/(.*)/); - minioUrl = match[1] + // let url = imgUrl.split('?')[0] + // var match = url.match(/^(?:https?:\/\/[^\/]+)\/(.*)/); + // minioUrl = match[1] + const { pathname } = new URL(imgUrl); + const result = pathname.slice(1); + minioUrl = result // let id = let proportion = img.height / img.width; //计算图形宽高比例 let scaleWH = imgWidth[key] / img.width; //计算放到画布上缩小倍率 diff --git a/src/tool/canvasGeneralCopy.js b/src/tool/canvasGeneralCopy.js index 0f5f2a55..b4989060 100644 --- a/src/tool/canvasGeneralCopy.js +++ b/src/tool/canvasGeneralCopy.js @@ -1147,9 +1147,12 @@ class MyCanvas { } let imgWidth = await this.setImageWidth(key,img); if(imgUrl?.split('?')){ - let url = imgUrl.split('?')[0] - var match = url.match(/^(?:https?:\/\/[^\/]+)\/(.*)/); - minioUrl = match[1] + // let url = imgUrl.split('?')[0] + // var match = url.match(/^(?:https?:\/\/[^\/]+)\/(.*)/); + // minioUrl = match[1] + const { pathname } = new URL(imgUrl); + const result = pathname.slice(1); + minioUrl = result } let proportion = img.height / img.width; //计算图形宽高比例 let scaleWH = imgWidth / img.width; //计算放到画布上缩小倍率