error.go 462 B

123456789101112131415161718192021
  1. package controllers
  2. import "eta/eta_mini_bridge/models"
  3. // ErrorController
  4. // @Description: 该控制器处理页面错误请求
  5. type ErrorController struct {
  6. BaseCommonController
  7. }
  8. func (c *ErrorController) Error404() {
  9. c.Data["content"] = "很抱歉您访问的地址或者方法不存在"
  10. //c.TplName = "error/404.html"
  11. br := new(models.BaseResponse).Init()
  12. br.Msg = "您访问的资源不存在"
  13. br.Ret = 404
  14. c.Data["json"] = br
  15. c.ServeJSON()
  16. }