1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 22:18:07 +08:00

fix: 解决网站路径重定向不保留URL参数不生效的问题 (#1855)

This commit is contained in:
zhengkunwang 2023-08-06 17:50:01 +08:00 committed by GitHub
parent 480b8acd66
commit 07d5c580a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -2042,6 +2042,8 @@ func (w WebsiteService) OperateRedirect(req request.NginxRedirectReq) (err error
case "path": case "path":
if req.KeepPath { if req.KeepPath {
target = req.Target + "$1" target = req.Target + "$1"
} else {
target = req.Target + "?"
} }
redirectKey := "permanent" redirectKey := "permanent"
if req.Redirect == "302" { if req.Redirect == "302" {
@ -2210,7 +2212,7 @@ func (w WebsiteService) GetRedirect(id uint) (res []response.NginxRedirectConfig
redirectConfig.Target = strings.TrimSuffix(params[1], "$1") redirectConfig.Target = strings.TrimSuffix(params[1], "$1")
} else { } else {
redirectConfig.KeepPath = false redirectConfig.KeepPath = false
redirectConfig.Target = params[1] redirectConfig.Target = strings.TrimSuffix(params[1], "?")
} }
if params[2] == "permanent" { if params[2] == "permanent" {
redirectConfig.Redirect = "301" redirectConfig.Redirect = "301"

View File

@ -38,7 +38,7 @@
</el-table-column> </el-table-column>
<fu-table-operations <fu-table-operations
:ellipsis="10" :ellipsis="10"
width="260px" width="220px"
:buttons="buttons" :buttons="buttons"
:label="$t('commons.table.operate')" :label="$t('commons.table.operate')"
:fixed="mobile ? false : 'right'" :fixed="mobile ? false : 'right'"