/// <summary> /// 获取待签名的内容 /// </summary> /// <param name="req"></param> /// <returns></returns> public static string GetSignData(JdWithdrawBaseReq req) { var dic = new Dictionary <string, string>(); foreach (var prop in req.GetType().GetProperties()) { var attrs = prop.GetCustomAttributes(typeof(JsonPropertyAttribute), false) as JsonPropertyAttribute[]; if (attrs.Any()) { var attr = attrs.First(); var value = Convert.ToString(prop.GetValue(req)); if (!String.IsNullOrEmpty(value) && !IGNORES.Contains(attr.PropertyName)) { dic.Add(attr.PropertyName, value); } } } return(String.Join("&", dic.OrderBy(w => w.Key).Select(w => $"{w.Key}={w.Value}"))); }