423 Star 2K Fork 720

进击的皇虫/DocHub

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ErrorsController.go 872 Bytes
一键复制 编辑 原始数据 按行查看 历史
TruthHun 提交于 2019-03-07 21:49 +08:00 . 程序优化
package HomeControllers
import "github.com/astaxie/beego"
type ErrorsController struct {
beego.Controller
}
//404
func (this *ErrorsController) Error404() {
referer := this.Ctx.Request.Referer()
this.Layout = ""
this.Data["content"] = "Page Not Foud"
this.Data["code"] = "404"
this.Data["content_zh"] = "页面不存在"
this.Data["Referer"] = referer
if len(referer) > 0 {
this.Data["IsReferer"] = true
}
this.TplName = "error.html"
}
//501
func (this *ErrorsController) Error501() {
this.Layout = ""
this.Data["code"] = "501"
this.Data["content"] = "Server Error"
this.Data["content_zh"] = "服务内部错误"
this.TplName = "error.html"
}
//数据库错误
func (this *ErrorsController) ErrorDb() {
this.Layout = ""
this.Data["content"] = "Database is now down"
this.Data["content_zh"] = "数据库访问失败"
this.TplName = "error.html"
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/truthhun/DocHub.git
git@gitee.com:truthhun/DocHub.git
truthhun
DocHub
DocHub
01033d1926ec

搜索帮助