| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using Newtonsoft.Json.Linq; |
| | | using System.Runtime.CompilerServices; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | /// 测试验签加密 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | [Verification] |
| | | [HttpPost] |
| | | public IActionResult Demo2(IdVm model) |
| | |
| | | } |
| | | } |
| | | |
| | | [HttpGet] |
| | | [HttpPost] |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public string Demo3() |
| | | [UnitOfWork] |
| | | public string Demo3(IdVm model) |
| | | { |
| | | string jsonParams = "{\"param1\": \"value1\", \"param2\": \"value2\"}"; |
| | | string jsonParams = JsonConvert.SerializeObject(model); |
| | | |
| | | // 生成时间戳(Unix 时间戳) |
| | | var timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(); |
| | |
| | | |
| | | private static string GenerateSignature(string jsonParams) |
| | | { |
| | | var appKey = "90170307d4184844ac2a26b431f79980"; |
| | | var appKey = "90170307d4184844ac2a26b431f79981"; |
| | | // 将 JSON 字符串转换为 JObject |
| | | JObject jObject = JObject.Parse(jsonParams); |
| | | |