From 83fd02c4c0bcb2b924c61d1f3a0b8ccbac18bc43 Mon Sep 17 00:00:00 2001 From: zpc Date: Sat, 24 Jan 2026 19:47:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E7=A7=81=E9=92=A5=E6=A0=BC=E5=BC=8F=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E9=97=AE=E9=A2=98=20-=20=E5=A4=84=E7=90=86JSON?= =?UTF-8?q?=E4=B8=AD=E8=BD=AC=E4=B9=89=E7=9A=84=E6=8D=A2=E8=A1=8C=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miniapp/config/index.js | 4 ++-- server/src/XiangYi.Infrastructure/WeChat/WeChatService.cs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/miniapp/config/index.js b/miniapp/config/index.js index bbe8a5f..6bdbd8d 100644 --- a/miniapp/config/index.js +++ b/miniapp/config/index.js @@ -15,7 +15,7 @@ const ENV = { }, // 生产环境 - 部署时修改这里的地址 production: { - API_BASE_URL: 'https://app.zpc-xy.com/xyqj/api/app', + API_BASE_URL: 'https://app.zpc-xy.com/xyqj/api/api/app', STATIC_BASE_URL: 'https://app.zpc-xy.com', ADMIN_API_BASE_URL: 'https://app.zpc-xy.com/xyqj/admin/', SIGNALR_URL: 'wss://app.zpc-xy.com/xyqj/api/hubs/chat' @@ -23,7 +23,7 @@ const ENV = { } // 当前环境 - 开发时使用 development,打包时改为 production -const CURRENT_ENV = 'development' +const CURRENT_ENV = 'production' // 导出配置 export const config = { diff --git a/server/src/XiangYi.Infrastructure/WeChat/WeChatService.cs b/server/src/XiangYi.Infrastructure/WeChat/WeChatService.cs index fbf338b..dcf13bd 100644 --- a/server/src/XiangYi.Infrastructure/WeChat/WeChatService.cs +++ b/server/src/XiangYi.Infrastructure/WeChat/WeChatService.cs @@ -430,7 +430,9 @@ public class WeChatService : IWeChatService private string SignWithPrivateKey(string message) { using var rsa = RSA.Create(); - rsa.ImportFromPem(_options.Pay.PrivateKey); + // 处理 JSON 中转义的换行符 + var privateKey = _options.Pay.PrivateKey.Replace("\\n", "\n"); + rsa.ImportFromPem(privateKey); var data = Encoding.UTF8.GetBytes(message); var signature = rsa.SignData(data, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);