From 312ebed2d86858e4fb57ec09679244e9b806b57f Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期五, 28 十一月 2025 17:56:10 +0800
Subject: [PATCH] feat:开发

---
 ApiTools.Core/Utils/WxmpUtils/WxmpUtils.cs |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/ApiTools.Core/Utils/WxmpUtils/WxmpUtils.cs b/ApiTools.Core/Utils/WxmpUtils/WxmpUtils.cs
index 33c360c..39321b6 100644
--- a/ApiTools.Core/Utils/WxmpUtils/WxmpUtils.cs
+++ b/ApiTools.Core/Utils/WxmpUtils/WxmpUtils.cs
@@ -161,11 +161,6 @@
             if (option == null || option.AppId.IsNull() || option.AppSecret.IsNull())
                 throw Oops.Oh(EnumErrorCodeType.s400, "鍙戦�佽闃呮秷鎭け璐ワ紝缂哄け閰嶇疆锛歐xmpOptions");
             command.EnvVersion = option.EnvVersion;
-            if (!options.Value.SubscribMessageTemplates.ContainsKey(command.TemplateId))
-                throw Oops.Oh(EnumErrorCodeType.s400, "鍙戦�佽闃呮秷鎭け璐ワ紝妯℃澘涓嶅瓨鍦�");
-            var template = options.Value.SubscribMessageTemplates[command.TemplateId];
-            command.TemplateId = template.TemplateId;
-            if (command.Page.IsNull()) command.Page = template.Page;
             var accessToken = await GetAccessToken(command.WxmpCode);
             var jsonContent = JsonConvert.SerializeObject(command, new JsonSerializerSettings
             {
@@ -176,13 +171,10 @@
                 .WithQueryParameter("access_token", accessToken)
                 .SetJsonContent(jsonContent));
             response.EnsureSuccessStatusCode();
-            if (response.Content.Headers.ContentType.ToString() == "application/json; charset=UTF-8")
-            {
-                var jsonResult = await response.Content.ReadAsStringAsync();
-                var callback = jsonResult.JsonTo<WxmpSendSubscribMessageResponse>();
-                if (callback == null || callback.ErrorCode != 0)
-                    throw Oops.Oh(EnumErrorCodeType.s510, $"鍙戦�佽闃呮秷鎭け璐ワ細{callback.ErrorMessage}锛岃鑱旂郴绠$悊鍛�");
-            }
+            var jsonResult = await response.Content.ReadAsStringAsync();
+            var callback = jsonResult.JsonTo<WxmpSendSubscribMessageResponse>();
+            if (callback == null || callback.ErrorCode != 0)
+                throw Oops.Oh(EnumErrorCodeType.s510, $"鍙戦�佽闃呮秷鎭け璐ワ細{callback.ErrorMessage}锛岃鑱旂郴绠$悊鍛�");
         }
     }
 }

--
Gitblit v1.9.1