码农笔录博客源码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
667 B

6 years ago
package controllers
import (
6 years ago
"beeblog/service"
4 years ago
beego "github.com/beego/beego/v2/server/web"
6 years ago
)
type IndexController struct {
beego.Controller
}
6 years ago
func (this *IndexController) Get() {
6 years ago
blogService := service.BlogService{}
timeBlog, _ := blogService.IndexBlogs(20, 0)
6 years ago
this.Data["TimeBlog"] = timeBlog
browsBlog, _ := blogService.IndexBlogs(20, 1)
6 years ago
this.Data["BrowsBlog"] = browsBlog
this.Data["UserId"] = this.GetSession("userid")
this.Data["HeadImg"] = this.GetSession("headimg")
this.Data["NickName"] = this.GetSession("nickname")
this.Data["IsLogin"] = this.GetSession("nickname") != nil
this.Data["IsHome"] = true
this.TplName = "index.html"
6 years ago
return
6 years ago
}