Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.3.2^2
zouap 3 years ago
parent
commit
bc6846dc81
1 changed files with 3 additions and 8 deletions
  1. +3
    -8
      routers/search.go

+ 3
- 8
routers/search.go View File

@@ -3,6 +3,7 @@ package routers
import (
"encoding/json"
"fmt"
"path/filepath"
"strconv"
"strings"

@@ -212,9 +213,9 @@ func makeRepoResult(sRes *elastic.SearchResult, Key string, OnlyReturnNum bool)
}
if recordSource["avatar"] != nil {
avatarstr := recordSource["avatar"].(string)
if len(avatarstr) == 0{
if len(avatarstr) == 0 {
record["avatar"] = setting.RepositoryAvatarFallbackImage
}else{
} else {
record["avatar"] = filepath.Join(setting.RepositoryAvatarUploadPath, avatarstr)
}
}
@@ -237,12 +238,6 @@ func makeRepoResult(sRes *elastic.SearchResult, Key string, OnlyReturnNum bool)
return returnObj
}

avatarPath := repo.CustomAvatarPath()
if len(avatarPath) == 0 || !com.IsFile(avatarPath) {
switch mode := setting.RepositoryAvatarFallback; mode {
case "image":
return setting.RepositoryAvatarFallbackImage

func dealLongText(text string, Key string, MatchedQueries []string) string {
var isNeedToDealText bool
isNeedToDealText = false


Loading…
Cancel
Save