码农笔录博客源码
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 година
package controllers
import (
пре 6 година
"beeblog/service"
пре 4 година
beego "github.com/beego/beego/v2/server/web"
пре 6 година
)
type IndexController struct {
beego.Controller
}
пре 6 година
func (this *IndexController) Get() {
пре 6 година
blogService := service.BlogService{}
пре 3 година
timeBlog, _ := blogService.IndexBlogs(27, 0)
пре 6 година
this.Data["TimeBlog"] = timeBlog
пре 3 година
browsBlog, _ := blogService.IndexBlogs(27, 1)
пре 6 година
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 година
return
пре 6 година
}