From fa034d54b6f75b1d53db70792a711332a16ec4da Mon Sep 17 00:00:00 2001 From: BaboonKing Date: Wed, 18 Oct 2023 13:46:50 +0800 Subject: [PATCH] fix: duplicate query param of tifPreviewType on url --- server/src/main/resources/web/pdf.ftl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/src/main/resources/web/pdf.ftl b/server/src/main/resources/web/pdf.ftl index 4d5a26f5..845ac8ca 100644 --- a/server/src/main/resources/web/pdf.ftl +++ b/server/src/main/resources/web/pdf.ftl @@ -37,7 +37,14 @@ } function goForImage() { - var url = window.location.href + "&tifPreviewType=jpg" + var url = window.location.href + + if (url.indexOf("tifPreviewType=pdf") != -1) { + url = url.replace("tifPreviewType=pdf", "tifPreviewType=jpg"); + } else { + url = url + "&tifPreviewType=jpg"; + } + if (url.indexOf("officePreviewType=pdf") != -1) { url = url.replace("officePreviewType=pdf", "officePreviewType=image"); } else {