diff --git a/CoreCms.Net.Services/Message/CoreCmsSmsServices.cs b/CoreCms.Net.Services/Message/CoreCmsSmsServices.cs index db601710..d0527508 100644 --- a/CoreCms.Net.Services/Message/CoreCmsSmsServices.cs +++ b/CoreCms.Net.Services/Message/CoreCmsSmsServices.cs @@ -343,7 +343,7 @@ namespace CoreCms.Net.Services var dt = DateTime.Now; //获取当前ip今日的发送记录 - var ip = _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress != null ? _httpContextAccessor.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString() : ""; + var ip = _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress != null ? _httpContextAccessor.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString() : "127.0.0.1"; if (string.IsNullOrEmpty(ip)) { jm.msg = "短信发送IP获取失败";