From 20d37f66ad4087420209f71b2b176ed4fe113948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Mon, 25 Dec 2023 00:48:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=AF=86=E5=BE=AE=E4=BF=A1appid?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 24Hour/WechatMessagerClient.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/24Hour/WechatMessagerClient.cs b/24Hour/WechatMessagerClient.cs index b559baf..8c79df8 100644 --- a/24Hour/WechatMessagerClient.cs +++ b/24Hour/WechatMessagerClient.cs @@ -2,6 +2,7 @@ using com.sun.xml.@internal.xsom; using Elight.Utility; using Elight.Utility.Code; +using Elight.Utility.Encrypt; using Elight.Utility.Extensions; using java.lang.annotation; using java.util; @@ -9,6 +10,7 @@ using Microsoft.IdentityModel.Logging; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Runtime.Caching; +using System.Security.Cryptography; using static java.security.cert.CertPathValidatorException; namespace _24Hour @@ -56,15 +58,14 @@ namespace _24Hour httpCliet.DefaultRequestHeaders.ConnectionClose = true; _configuration = configuration; - appid = $"{configuration.GetSection("Wechat:appid").Value}"; - secret = $"{configuration.GetSection("Wechat:secret").Value}"; - secid = $"{configuration.GetSection("Wechat:secid").Value}"; - Gzhappid = $"{configuration.GetSection("WechatGzh:appid").Value}"; - Gzhsecret = $"{configuration.GetSection("WechatGzh:secret").Value}"; - GzhtemplateId = $"{configuration.GetSection("WechatGzh:templateId").Value}"; - TemplateIdSuccess = $"{configuration.GetSection("Wechat:templateIdSuccess").Value}"; - TemplateIdFail = $"{configuration.GetSection("Wechat:templateIdFail").Value}"; - TemplateIdFail = $"{configuration.GetSection("Wechat:templateIdFail").Value}"; + appid =AES.Decrypt( $"{configuration.GetSection("Wechat:appid").Value}"); + secret = AES.Decrypt($"{configuration.GetSection("Wechat:secret").Value}"); + secid = AES.Decrypt($"{configuration.GetSection("Wechat:secid").Value}"); + Gzhappid = AES.Decrypt($"{configuration.GetSection("WechatGzh:appid").Value}"); + Gzhsecret = AES.Decrypt($"{configuration.GetSection("WechatGzh:secret").Value}"); + GzhtemplateId = AES.Decrypt($"{configuration.GetSection("WechatGzh:templateId").Value}"); + TemplateIdSuccess = AES.Decrypt($"{configuration.GetSection("Wechat:templateIdSuccess").Value}"); + TemplateIdFail = AES.Decrypt($"{configuration.GetSection("Wechat:templateIdFail").Value}"); } //小程序获取openId public async Task GetOpenId(string code)