From 16bbcdca6df2c141c7a44fedb175f72a4ee6a4e1 Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 5 Dec 2023 15:41:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9Aparams=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=AD=A3=E5=B8=B8=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/hat/repo/file.go | 4 ++-- routers/hat/repo/tag.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/routers/hat/repo/file.go b/routers/hat/repo/file.go index b3558f9..5da080f 100644 --- a/routers/hat/repo/file.go +++ b/routers/hat/repo/file.go @@ -134,7 +134,7 @@ func GetReadmeContents(ctx *context.APIContext) { return } - ref := ctx.Params(":ref") + ref := ctx.FormString("ref") readmeSortArr := []string{"readme", "readme.en.md", "readme_en.md", "readme.md", "readme.ch.md", "readme_ch.md", "readme.zh.md", "readme_zh.md", "readme.cn.md", "readme_cn.md"} readmePath := "" readmePathInArrIndex := 0 @@ -188,7 +188,7 @@ func GetReadmeContentsByPath(ctx *context.APIContext) { return } treePath := ctx.Params("*") - ref := ctx.Params(":ref") + ref := ctx.FormString("ref") readmeSortArr := []string{"readme", "readme.en.md", "readme_en.md", "readme.md", "readme.ch.md", "readme_ch.md", "readme.zh.md", "readme_zh.md", "readme.cn.md", "readme_cn.md"} readmePath := "" readmePathInArrIndex := 0 diff --git a/routers/hat/repo/tag.go b/routers/hat/repo/tag.go index feaa334..15206d6 100644 --- a/routers/hat/repo/tag.go +++ b/routers/hat/repo/tag.go @@ -66,7 +66,7 @@ func BranchTagCount(ctx *context.APIContext) { func BranchNameSet(ctx *context.APIContext) { - searchName := ctx.Params("name") + searchName := ctx.FormString("name") branches, _, err := ctx.Repo.GitRepo.GetBranchNames(0, 0) //get count of the branch if err != nil { ctx.ServerError("GetBranches", err) @@ -90,7 +90,7 @@ func BranchNameSet(ctx *context.APIContext) { func TagNameSet(ctx *context.APIContext) { - searchName := ctx.Params("name") + searchName := ctx.FormString("name") tags, err := ctx.Repo.GitRepo.GetTags(0, 0) if err != nil {