Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0013404

Browse files
committed
fix:没有数据循环重定向
1 parent a8030eb commit 0013404

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

src/http/controller/article.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ func (ArticleController) ReadList(ctx echo.Context) error {
6666

6767
num := len(articles)
6868
if num == 0 {
69-
if curPage == int(total) {
70-
return render(ctx, "articles/list.html", map[string]interface{}{"articles": articles, "activeArticles": "active"})
71-
}
72-
return ctx.Redirect(http.StatusSeeOther, "/articles")
69+
return render(ctx, "articles/list.html", map[string]interface{}{"articles": articles, "activeArticles": "active"})
7370
}
7471

7572
// 获取当前用户喜欢对象信息

src/http/controller/project.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ func (ProjectController) ReadList(ctx echo.Context) error {
5454

5555
num := len(projects)
5656
if num == 0 {
57-
if curPage == int(total) {
58-
return render(ctx, "projects/list.html", map[string]interface{}{"projects": projects, "activeProjects": "active"})
59-
} else {
60-
return ctx.Redirect(http.StatusSeeOther, "/projects")
61-
}
57+
return render(ctx, "projects/list.html", map[string]interface{}{"projects": projects, "activeProjects": "active"})
6258
}
6359

6460
// 获取当前用户喜欢对象信息

template/install/install.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<link rel="stylesheet" href="/static/css/install/install.css" type="text/css" />
77
</head>
88
<body>
9-
<h1 id="logo"><img alt="WordPress" src="/static/img/logo1.png" /></h1>
9+
<h1 id="logo"><img alt="studygolang" src="/static/img/logo1.png" /></h1>
1010
{{if eq .step 3}}
1111
<h1>成功!</h1>
1212

0 commit comments

Comments
 (0)