error.go 465 B

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