Browse Source

加密微信appid信息

develop-FileUpload-test
胡超1 2 years ago
parent
commit
20d37f66ad
  1. 19
      24Hour/WechatMessagerClient.cs

19
24Hour/WechatMessagerClient.cs

@ -2,6 +2,7 @@
using com.sun.xml.@internal.xsom; using com.sun.xml.@internal.xsom;
using Elight.Utility; using Elight.Utility;
using Elight.Utility.Code; using Elight.Utility.Code;
using Elight.Utility.Encrypt;
using Elight.Utility.Extensions; using Elight.Utility.Extensions;
using java.lang.annotation; using java.lang.annotation;
using java.util; using java.util;
@ -9,6 +10,7 @@ using Microsoft.IdentityModel.Logging;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System.Runtime.Caching; using System.Runtime.Caching;
using System.Security.Cryptography;
using static java.security.cert.CertPathValidatorException; using static java.security.cert.CertPathValidatorException;
namespace _24Hour namespace _24Hour
@ -56,15 +58,14 @@ namespace _24Hour
httpCliet.DefaultRequestHeaders.ConnectionClose = true; httpCliet.DefaultRequestHeaders.ConnectionClose = true;
_configuration = configuration; _configuration = configuration;
appid = $"{configuration.GetSection("Wechat:appid").Value}"; appid =AES.Decrypt( $"{configuration.GetSection("Wechat:appid").Value}");
secret = $"{configuration.GetSection("Wechat:secret").Value}"; secret = AES.Decrypt($"{configuration.GetSection("Wechat:secret").Value}");
secid = $"{configuration.GetSection("Wechat:secid").Value}"; secid = AES.Decrypt($"{configuration.GetSection("Wechat:secid").Value}");
Gzhappid = $"{configuration.GetSection("WechatGzh:appid").Value}"; Gzhappid = AES.Decrypt($"{configuration.GetSection("WechatGzh:appid").Value}");
Gzhsecret = $"{configuration.GetSection("WechatGzh:secret").Value}"; Gzhsecret = AES.Decrypt($"{configuration.GetSection("WechatGzh:secret").Value}");
GzhtemplateId = $"{configuration.GetSection("WechatGzh:templateId").Value}"; GzhtemplateId = AES.Decrypt($"{configuration.GetSection("WechatGzh:templateId").Value}");
TemplateIdSuccess = $"{configuration.GetSection("Wechat:templateIdSuccess").Value}"; TemplateIdSuccess = AES.Decrypt($"{configuration.GetSection("Wechat:templateIdSuccess").Value}");
TemplateIdFail = $"{configuration.GetSection("Wechat:templateIdFail").Value}"; TemplateIdFail = AES.Decrypt($"{configuration.GetSection("Wechat:templateIdFail").Value}");
TemplateIdFail = $"{configuration.GetSection("Wechat:templateIdFail").Value}";
} }
//小程序获取openId //小程序获取openId
public async Task<Result> GetOpenId(string code) public async Task<Result> GetOpenId(string code)

Loading…
Cancel
Save