/// <summary> /// 设置错误信息 /// </summary> /// <param name="result"></param> /// <param name="code">错误代码</param> public static void SetError(this IResult result, ErrorCode code) { result.Code = (int)code; result.Message = code.GetDesc(); result.Exception = null; }