优化阿里云短信发送功能。

This commit is contained in:
jianweie code
2024-02-29 15:58:10 +08:00
parent 36dfe3b5c4
commit b7cda465f4
2 changed files with 15 additions and 17 deletions

View File

@@ -90,16 +90,14 @@ namespace CoreCms.Net.Services
mobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopMobile);
}
//发货时,短信通知用发货人的
if (code == GlobalEnumVars.PlatformMessageTypes.DeliveryNotice.ToString())
if (code == GlobalEnumVars.PlatformMessageTypes.DeliveryNotice.ToString() && parameters.ContainsKey("shipMobile"))
{
if (parameters.ContainsKey("shipMobile"))
{
mobile = parameters["shipMobile"].ObjectToString();
}
mobile = parameters["shipMobile"].ObjectToString();
}
if (!string.IsNullOrEmpty(mobile))
{
await smsServices.Send(mobile, code, parameters);
var smsOut = await smsServices.Send(mobile, code, parameters);
NLogUtil.WriteAll(LogLevel.Trace, LogType.Other, "短信发送反馈", JsonConvert.SerializeObject(smsOut));
}
}
}