Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.21.12.1^2
zouap 4 years ago
parent
commit
9e97819015
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      routers/home.go

+ 10
- 2
routers/home.go View File

@@ -535,10 +535,18 @@ func recommendFromPromote(ctx *context.Context, url string) {

allLineStr := string(bytes)
lines := strings.Split(allLineStr, "\n")
result := make([]string, len(lines))
for i, line := range lines {
log.Info("i=" + fmt.Sprint(i) + " line=" + line)

tmpIndex := strings.Index(line, ".")
log.Info("i=" + fmt.Sprint(i) + " line=" + line + " tmpIndex=" + fmt.Sprint(tmpIndex))
if tmpIndex == -1 {
continue
} else {
result[i] = strings.Trim(line[tmpIndex:], " ")
}
}
ctx.JSON(http.StatusOK, lines)
ctx.JSON(http.StatusOK, result)
}

func RecommendRepoFromPromote(ctx *context.Context) {


Loading…
Cancel
Save