码农笔录博客源码
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

50 líneas
1.1 KiB

hace 6 años
package controllers
import (
hace 6 años
"beeblog/models"
hace 3 años
"beeblog/service"
beego "github.com/beego/beego/v2/server/web"
)
hace 6 años
type PageController struct {
beego.Controller
}
hace 6 años
func (this *PageController) IframeUser() {
hace 5 años
userService := service.UserService{}
hace 6 años
uid := this.GetSession("userid")
if uid == nil {
this.Data["IsLogin"] = false
} else {
this.Data["IsLogin"] = true
hace 5 años
if user, err := userService.GetUser(uid.(int64)); err == nil {
hace 6 años
this.Data["User"] = user
} else {
this.Data["User"] = &models.User{Id: uid.(int64)}
}
}
this.TplName = "iframe/user.html"
return
}
hace 6 años
func (this *PageController) UsPage() {
this.Data["IsUs"] = true
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
hace 6 años
this.TplName = "us.html"
}
hace 6 años
func (this *PageController) PageNotFound() {
this.TplName = "404.html"
}
func (this *PageController) ServerError() {
this.TplName = "500.html"
}
hace 6 años
func (this *PageController) ServerDemined() {
this.TplName = "403.html"
}