From 5d94e93813ca45250287c802db2ad8796eeabe79 Mon Sep 17 00:00:00 2001
From: hwh <332078369@qq.com>
Date: 星期五, 19 七月 2024 15:56:22 +0800
Subject: [PATCH] Merge branch 'master' of http://47.95.120.53:8083/r/JC26WMS
---
Wms/Utility/Filter/ApiSignatureVerificationAttribute.cs | 28 ++++++++++++++++------------
1 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/Wms/Utility/Filter/ApiSignatureVerificationAttribute.cs b/Wms/Utility/Filter/ApiSignatureVerificationAttribute.cs
index 1f2adb2..511d68d 100644
--- a/Wms/Utility/Filter/ApiSignatureVerificationAttribute.cs
+++ b/Wms/Utility/Filter/ApiSignatureVerificationAttribute.cs
@@ -91,20 +91,24 @@
// 鍙嶅簭鍒楀寲 JSON 鍙傛暟涓� JObject
JObject jObject = null;
- try
+ Dictionary<string, string> filteredProperties = new Dictionary<string, string>();
+ if (jsonParams != null)
{
- jObject = JObject.Parse(jsonParams);
+ try
+ {
+ jObject = JObject.Parse(jsonParams);
+ // 杩囨护鎺夋暟缁勭被鍨嬬殑灞炴��
+ filteredProperties = jObject.Properties()
+ .Where(p => p.Value.Type != JTokenType.Array)
+ .ToDictionary(p => p.Name, p => p.Value.ToString());
+ }
+ catch (JsonReaderException)
+ {
+ // JSON 鏍煎紡閿欒锛岃繑鍥炴湭缁忔巿鏉�
+ context.Result = new UnauthorizedResult();
+ return;
+ }
}
- catch (JsonReaderException)
- {
- // JSON 鏍煎紡閿欒锛岃繑鍥炴湭缁忔巿鏉�
- context.Result = new UnauthorizedResult();
- return;
- }
- // 杩囨护鎺夋暟缁勭被鍨嬬殑灞炴��
- var filteredProperties = jObject.Properties()
- .Where(p => p.Value.Type != JTokenType.Array)
- .ToDictionary(p => p.Name, p => p.Value.ToString());
filteredProperties.Add("timestamp", timestamp);
filteredProperties.Add("appKey", appKey);
--
Gitblit v1.8.0