style: clean code

This commit is contained in:
Fu Diwei 2021-07-30 20:10:36 +08:00
parent 35633fa519
commit a5e261a735
2 changed files with 5 additions and 2 deletions

View File

@ -40,7 +40,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
{ "offer_id", HttpUtility.UrlEncode(request.MidasOfferId ?? string.Empty) },
{ "zone_id", HttpUtility.UrlEncode(request.MidasZoneId ?? string.Empty) },
{ "pf", HttpUtility.UrlEncode(request.Platform ?? string.Empty) },
{ "ts", request.Timestamp.ToString() }
{ "ts", request.Timestamp.ToString()! }
}
);
string plainText = string.Join("&", paramMap.Select(e => $"{e.Key}={e.Value}"))

View File

@ -275,7 +275,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Utilities
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);
XmlNode xmlRoot = xmlDoc.FirstChild;
XmlNode? xmlRoot = xmlDoc.FirstChild;
if (xmlRoot == null)
return false;
encryptedMsg = xmlRoot["Encrypt"]?.InnerText?.ToString();
toUserName = xmlRoot["ToUserName"]?.InnerText?.ToString();
agentId = xmlRoot["AgentID"]?.InnerText?.ToString();