From dd0c15d275b976e831f22bff4590d3a691b19116 Mon Sep 17 00:00:00 2001 From: dao Date: Thu, 26 Dec 2024 17:41:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9F=AD=E4=BF=A1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Yixintong/YixintongSms.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Quanjiang.DigitalScholl.SendSms/Yixintong/YixintongSms.cs b/Learun.Framework.Ultimate V7/Quanjiang.DigitalScholl.SendSms/Yixintong/YixintongSms.cs index 2355fdc31..f6793be28 100644 --- a/Learun.Framework.Ultimate V7/Quanjiang.DigitalScholl.SendSms/Yixintong/YixintongSms.cs +++ b/Learun.Framework.Ultimate V7/Quanjiang.DigitalScholl.SendSms/Yixintong/YixintongSms.cs @@ -16,9 +16,9 @@ namespace Quanjiang.DigitalScholl.SendSms /// public class YixintongSms:ISms { - private static readonly string SpCode = ConfigManager.AppSettings["SpCode"].Value;//企业编号 - private static readonly string LoginName = ConfigManager.AppSettings["LoginName"].Value;//用户名 - private static readonly string Password = ConfigManager.AppSettings["Password"].Value;//接口密钥 + private static string SpCode = ConfigManager.AppSettings["SpCode"].Value;//企业编号 + private static string LoginName = ConfigManager.AppSettings["LoginName"].Value;//用户名 + private static string Password = ConfigManager.AppSettings["Password"].Value;//接口密钥 public async Task<(string code, string randomNum, string message, string errorType)> SendSmsToSingle(string phoneNumber, SmsType st, List sendParams = null) { @@ -26,6 +26,9 @@ namespace Quanjiang.DigitalScholl.SendSms var (templatecode, templateparam, randomNum) = GetSmsTemplateBySmsType(st); try { + if (SpCode.IsEmpty()) SpCode = "320328"; + if (LoginName.IsEmpty()) LoginName = "9c34cbd5462e8034d9b779887c1e8398"; + if (Password.IsEmpty()) Password = "29745012d0575978cd8c93d8d6c62f9d96e6b808eb9ac87845721c7c29b39c8f"; StringBuilder sb=new StringBuilder(); // 按照协议组织 post 请求包体 sb.Append("SpCode="+SpCode); @@ -39,6 +42,7 @@ namespace Quanjiang.DigitalScholl.SendSms //data.Add("ScheduleTime", ""); //data.Add("signCode", ""); //调接口 + Learun.Util.Log.LogHelper.Info(sb.ToString()); string pushresult = Learun.Util.HttpMethods.HttpPost("https://opassapi.infocloud.cc/sms/Api/Send.do", sb.ToString(), Encoding.GetEncoding("utf-8")); //返回体 pushresult = pushresult.Replace("
", "&");