lcl 1 سال پیش
والد
کامیت
41a0543fa5
3فایلهای تغییر یافته به همراه6 افزوده شده و 3 حذف شده
  1. 2 2
      AppStart/WeChatFunction.cs
  2. 1 0
      Areas/Api/Controllers/v1/MainServer/ConsumersController.cs
  3. 3 1
      Controllers/HomeController.cs

+ 2 - 2
AppStart/WeChatFunction.cs

@@ -315,7 +315,7 @@ namespace MySystem
         {
             GcmBlockCipher gcmBlockCipher = new GcmBlockCipher(new AesEngine());
             AeadParameters aeadParameters = new AeadParameters(
-                new KeyParameter(Encoding.UTF8.GetBytes("VyULlqfAW2gBfCNfLdupcL7zlha7d93F")),
+                new KeyParameter(Encoding.UTF8.GetBytes(AppConfig.WeChatParam.AesGemKey)),
                 128,
                 Encoding.UTF8.GetBytes(nonce),
                 Encoding.UTF8.GetBytes(associatedData));
@@ -341,7 +341,7 @@ namespace MySystem
 
         #region 敏感信息加密
 
-        string pubkey = "MIIEKDCCAxCgAwIBAgIUFOn9fwmBvqI/lBN2B1IctRxPdu8wDQYJKoZIhvcNAQELBQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsTFFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3QgQ0EwHhcNMjMwNjI2MDMwNTU2WhcNMjgwNjI0MDMwNTU2WjCBgTETMBEGA1UEAwwKMTYxMzExMjI4MTEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMS0wKwYDVQQLDCTlm5vlt53nnIHmtqbop4LnsbPnp5HmioDmnInpmZDlhazlj7gxCzAJBgNVBAYMAkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMqiiAP4NhHCJYIhZj0uSwEje1GjwwUFEOS1gr/Y0/oLWgFLdYtVw87ZA9q1PNlfWmNzeknMV42kknDoxiJIOlArMfvMt7Gr9QAxWilqU4N7Q3tNFZzbLJpn6GmkgS764Bl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06eOvbqooEG3imlgChcrHtcMHNK6mQtIqRRjZIbUQFaVXCag4mnkDWDnpRmidp7HwKBgQCtAZhik5vdzGT+UQmY679ILlT4fD7kKhUZ3PQVlmgITPJH9DWhyCM3HtRFpN2jTa4js4jrqSxlwQbcCffIRlMaqRhl+eEOYqSI/JheO+RhLerFVHeTFZAF7qnM4SHjvwAEswgoeQ6Xt8m//9bPeLCqjBcNU6wgHBDrbF/ddYba0QKBgH4lLjA5U0P4YBXuQpt0raazOy52+NLdJfMlkHV6ZC3IeOo+n9aDVjq9R5YaZKfexLcZEYvVI08cLcQJ5sK1nbh2/DmN0xf3cRMzU/TkXNmpSCNxy/0V9fPFKZVn9QHvdTS32Kvd9rLc6LXXjetuCDuVJ5DAPeRfbNHks9CmT973AoGBAK400faHTcodLHR/MXEmfI6BZlsTh2Cbm5q+k8Of095xKB/sfTWPprMQW+/U5OEQrKDbt+FI+psJFixmSNFuZdt4JU9P5/bp4SGIQpCfsp1p7GP/irc1yikrHXeGes9HPeUn7yGmvz4QC+sFO32haYr1SaAzZvMhf3RQVuAiFOnw"; //私钥
         public string RSAEncrypt(string text)
         {

+ 1 - 0
Areas/Api/Controllers/v1/MainServer/ConsumersController.cs

@@ -54,6 +54,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             string url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + new WeChatFunction().AppId + "&secret=" + new WeChatFunction().AppSecret + "&js_code=" + code + "&grant_type=authorization_code";
             function.WriteLog(url, "微信小程序通过code获取openid");
             string result = function.GetWebRequest(url);
+            function.WriteLog(result + "\n", "微信小程序通过code获取openid");
             JsonData jsonObj = JsonMapper.ToObject(result);
             string openid = jsonObj["openid"].ToString();
             string session_key = jsonObj["session_key"].ToString();

+ 3 - 1
Controllers/HomeController.cs

@@ -70,10 +70,12 @@ namespace MySystem.Controllers
 
             // result = new WeChatFunction().AddReceive("1645266943", "PERSONAL_OPENID", "ooDpv5LkCKEguE-LMZO-rSV4TDpk", "", "USER");
             // result = new WeChatFunction().QueryProfitShare("1645266943", "4200001815202306025662773463", "2023060213335030713572885");
-            result = new WeChatFunction().Unfreeze("1646405429","4200001838202306096719040741","2023060911284179905894403", "结算");
+            // result = new WeChatFunction().Unfreeze("1646405429","4200001838202306096719040741","2023060911284179905894403", "结算");
 
             // result = new WeChatFunction().ProfitShareReturn("1646405429", "1611167423", "2023060810550382756164803", DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8), 0.02M);
 
+            result = new WeChatFunction().GetPublicKey();
+
             return result;
         }
     }