From f4c0e96bcbbd98bb34103670a716c090384c266d Mon Sep 17 00:00:00 2001 From: YuanFeng <770153798@qq.com> Date: Wed, 11 Sep 2024 22:23:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/framework/file/core/utils/FileTypeUtils.java | 5 +++++ .../DraftDesign/components/DesignPropEdit.vue | 10 ++++------ .../DraftDesign/components/node/ShapeImageNode.vue | 7 ++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/hangtag-module-infra/hangtag-module-infra-biz/src/main/java/cn/hangtag/module/infra/framework/file/core/utils/FileTypeUtils.java b/hangtag-module-infra/hangtag-module-infra-biz/src/main/java/cn/hangtag/module/infra/framework/file/core/utils/FileTypeUtils.java index 71fdc7d..1a9cef2 100644 --- a/hangtag-module-infra/hangtag-module-infra-biz/src/main/java/cn/hangtag/module/infra/framework/file/core/utils/FileTypeUtils.java +++ b/hangtag-module-infra/hangtag-module-infra-biz/src/main/java/cn/hangtag/module/infra/framework/file/core/utils/FileTypeUtils.java @@ -69,6 +69,11 @@ public class FileTypeUtils { response.setHeader("Content-Range", String.valueOf(content.length - 1)); response.setHeader("Accept-Ranges", "bytes"); } + if (contentType.startsWith("image/")) { + // 设置缓存 + response.setHeader("Cache-Control", "max-age=604800"); + response.setHeader("Pragma", "public"); + } // 输出附件 IoUtil.write(response.getOutputStream(), false, content); } diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue index c2458f1..56f8a44 100644 --- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue +++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue @@ -198,7 +198,7 @@
+ :class="{ 'hidden-div': true }">
@@ -437,7 +437,7 @@ const loadConfig = (config: object, propData = {}) => { setTimeout(()=>{ showPng(); - },200) + },100) } const queryUseLabel = (label) => { @@ -498,17 +498,15 @@ const showPng = () => { loading.value = true setTimeout(() => { draftDesignEditRef.value.toPngUrl((url) => { + console.log("url",url) that.previewUrl = url const info = draftDesignEditRef.value.getPropInfo(); - that.propInfo = { ...info.propDefault, ...that.propInfo || {} }; that.propOrderByList = info.propOrderByList; - setTimeout(() => { - submit(); - }, 100) + submit(); loading.value = false; }, { widthScale: that.currentZoom, diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/node/ShapeImageNode.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/node/ShapeImageNode.vue index e17e939..2463fbc 100644 --- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/node/ShapeImageNode.vue +++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/node/ShapeImageNode.vue @@ -14,7 +14,7 @@ :style="svgStyle" > { + console.log("convertImageToBase64",this.cellInfo.style.shape.href,res) // @ts-ignore - // this.hrefBase64 = res - this.cellInfo.style.shape.href = res + this.hrefBase64 = res + // this.cellInfo.style.shape.hrefBase64 = res }) } setTimeout(() => {