|
@ -125,17 +125,6 @@ namespace TaskManager.Controllers |
|
|
private string GenerateSign(string method, string path, string appKey, string appSecret, string timestamp, string nonce, string jsonBody) |
|
|
private string GenerateSign(string method, string path, string appKey, string appSecret, string timestamp, string nonce, string jsonBody) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
//var options = new JsonSerializerOptions
|
|
|
|
|
|
//{
|
|
|
|
|
|
// WriteIndented = true, // 格式化缩进,方便阅读
|
|
|
|
|
|
// Encoder = System.Text.Encodings.Web.JavaScriptEncoder.Create(System.Text.Unicode.UnicodeRanges.All)
|
|
|
|
|
|
//};
|
|
|
|
|
|
|
|
|
|
|
|
//byte[] utf8Bytes = JsonSerializer.SerializeToUtf8Bytes(jsonBody, options);
|
|
|
|
|
|
//// 转成字符串(若需要字符串形式,可按需操作,不过直接传字节更高效)
|
|
|
|
|
|
//string jsonStr = Encoding.UTF8.GetString(utf8Bytes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string paramStr = $"method={method.ToUpper()}&path={path}&appKey={appKey}&appSecret={appSecret}×tamp={timestamp}&nonce={nonce}&jsonBody={jsonBody}"; |
|
|
string paramStr = $"method={method.ToUpper()}&path={path}&appKey={appKey}&appSecret={appSecret}×tamp={timestamp}&nonce={nonce}&jsonBody={jsonBody}"; |
|
|
return ComputeSHA512(paramStr); |
|
|
return ComputeSHA512(paramStr); |
|
|
|
|
|
|
|
|