From 6396dac27ca99e84a2e3c772fb079bceddf67ff8 Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期一, 01 十二月 2025 18:17:45 +0800
Subject: [PATCH] feat:开发
---
ApiTools.Core/Utils/WxmpUtils/WxmpUtils.cs | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/ApiTools.Core/Utils/WxmpUtils/WxmpUtils.cs b/ApiTools.Core/Utils/WxmpUtils/WxmpUtils.cs
index 864a1d8..5dcf926 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,12 @@
.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