/// <summary> /// 返回成功数据 /// </summary> /// <returns></returns> protected string Success(string msg = null) { JHeader.Status = 1; if (!msg.IsNoneOrNull()) { JResponse.Message = msg; } return(JResponse.ToString()); }
/// <summary> /// 返回失败数据 /// </summary> /// <param name="msg"></param> /// <returns></returns> protected string Fail(string msg = null) { JResponse.Result = 0; if (!msg.IsNoneOrNull()) { JResponse.Message = msg; } // 重载 this.OnRender(); return(JResponse.ToString()); }
/// <summary> /// 返回错误数据 /// </summary> /// <param name="code"></param> /// <param name="msg"></param> /// <param name="info"></param> /// <returns></returns> protected string Error(int code = 0, string msg = null, string info = null) { JHeader.Status = -1; if (!msg.IsNoneOrNull()) { JResponse.Message = msg; } JResponse.Error.Code = 0; if (info != null) { JResponse.Error.Info = info; } return(JResponse.ToString()); }
/// <summary> /// 返回错误数据 /// </summary> /// <param name="code"></param> /// <param name="msg"></param> /// <param name="info"></param> /// <returns></returns> protected string Error(int code = 0, string msg = null, string info = null) { JResponse.Result = -1; if (!msg.IsNoneOrNull()) { JResponse.Message = msg; } JResponse.Error.Code = 0; if (info != null) { JResponse.Error.Info = info; } // 重载 this.OnRender(); return(JResponse.ToString()); }