Browse Source

提交代码。

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

+ 6
- 2
routers/home.go View File

@@ -44,6 +44,11 @@ const (
func Home(ctx *context.Context) {
ctx.Data["PageIsHome"] = true
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
setRecommendURL(ctx)
ctx.HTML(200, tplHome)
}

func setRecommendURL(ctx *context.Context) {
addr := setting.RecommentRepoAddr[10:]
start := strings.Index(addr, "/")
end := strings.Index(addr, "raw")
@@ -52,7 +57,6 @@ func Home(ctx *context.Context) {
} else {
ctx.Data["RecommendURL"] = setting.RecommentRepoAddr
}
ctx.HTML(200, tplHome)
}

func Dashboard(ctx *context.Context) {
@@ -85,7 +89,7 @@ func Dashboard(ctx *context.Context) {
ctx.Redirect(setting.AppSubURL + "/user/login")
return
}
setRecommendURL(ctx)
ctx.Data["PageIsHome"] = true
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
ctx.HTML(200, tplHome)


Loading…
Cancel
Save