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

Skip to content

Commit 5e632f4

Browse files
committed
文章和项目一个都没有的时候跳转出错
1 parent ad3d521 commit 5e632f4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/http/controller/article.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ 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+
//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")
7373
}
7474

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

src/http/controller/project.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ 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+
//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+
//}
6262
}
6363

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

0 commit comments

Comments
 (0)