namespace Bootstrap.Admin.Models { /// /// /// public class ErrorModel { /// /// /// public int Id { get; set; } /// /// /// public string Title { get; set; } /// /// /// public string Content { get; set; } /// /// /// public string Image { get; set; } /// /// /// public string Detail { get; set; } /// /// /// public string ReturnUrl { get; set; } /// /// /// /// /// public static ErrorModel CreateById(int id) { var model = new ErrorModel { Id = id, Title = "服务器内部错误", Content = "服务器内部错误", Detail = "相关错误信息已经记录到日志中,请登录服务器或后台管理中查看", Image = "~/Images/error_icon.png", ReturnUrl = "~/Admin/Index" }; switch (id) { case 0: model.Content = "未处理服务器内部错误"; break; case 404: model.Title = "资源未找到"; model.Content = "请求资源未找到"; model.Image = "~/Images/404_icon.png"; break; case 403: model.Title = "未授权请求"; model.Content = "您的访问受限!"; model.Detail = "服务器拒绝处理您的请求!您可能没有访问此操作的权限"; break; } return model; } } }