/// <summary> /// 根据请求类型返回view或json /// </summary> /// <param name="model"></param> /// <param name="viewName"></param> /// <returns></returns> protected IActionResult DynamicResult(object model, string viewName = "") { if (IsRequestJson) { return(JResult.J(model)); } viewName = viewName.IfEmpty(WebContext.ActionName); return(View(viewName, model)); }
protected IActionResult JsonResult(bool isSuccess, object content, object extra = null) { return(JResult.J(isSuccess, content, extra)); }
protected IActionResult JsonResult(object content, object extra = null) { return(JResult.J("success", content, extra)); }