error.go 363 B

1234567891011121314151617181920
  1. package controllers
  2. import (
  3. "eta_gn/eta_index_lib/models"
  4. )
  5. type ErrorController struct {
  6. BaseCommonController
  7. }
  8. func (c *ErrorController) Error404() {
  9. c.Data["content"] = "很抱歉您访问的地址或者方法不存在"
  10. br := new(models.BaseResponse).Init()
  11. br.Msg = "您访问的资源不存在"
  12. br.Ret = 404
  13. c.Data["json"] = br
  14. c.ServeJSON()
  15. }