From 07d5c580a66a4735ea43cb8cc9a1fe332a9a4b8b Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Sun, 6 Aug 2023 17:50:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=87=8D=E5=AE=9A=E5=90=91=E4=B8=8D=E4=BF=9D?= =?UTF-8?q?=E7=95=99URL=E5=8F=82=E6=95=B0=E4=B8=8D=E7=94=9F=E6=95=88?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#1855)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/website.go | 4 +++- .../src/views/website/website/config/basic/redirect/index.vue | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/app/service/website.go b/backend/app/service/website.go index 6a32311ec..31fc46e06 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -2042,6 +2042,8 @@ func (w WebsiteService) OperateRedirect(req request.NginxRedirectReq) (err error case "path": if req.KeepPath { target = req.Target + "$1" + } else { + target = req.Target + "?" } redirectKey := "permanent" if req.Redirect == "302" { @@ -2210,7 +2212,7 @@ func (w WebsiteService) GetRedirect(id uint) (res []response.NginxRedirectConfig redirectConfig.Target = strings.TrimSuffix(params[1], "$1") } else { redirectConfig.KeepPath = false - redirectConfig.Target = params[1] + redirectConfig.Target = strings.TrimSuffix(params[1], "?") } if params[2] == "permanent" { redirectConfig.Redirect = "301" diff --git a/frontend/src/views/website/website/config/basic/redirect/index.vue b/frontend/src/views/website/website/config/basic/redirect/index.vue index 8720b20f4..74b4ec4b0 100644 --- a/frontend/src/views/website/website/config/basic/redirect/index.vue +++ b/frontend/src/views/website/website/config/basic/redirect/index.vue @@ -38,7 +38,7 @@