修复:params无法正常获取数据

This commit is contained in:
yystopf 2023-12-05 15:41:06 +08:00
parent 4717c93223
commit 16bbcdca6d
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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 {