feat: 格式化短信服务
This commit is contained in:
parent
4b6b1e2d6e
commit
ae746cd352
|
@ -7,8 +7,8 @@ using System.Security.Cryptography;
|
|||
using System.Text;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace BootstrapAdmin.Web.Services.SMS
|
||||
{
|
||||
namespace BootstrapAdmin.Web.Services.SMS;
|
||||
|
||||
/// <summary>
|
||||
/// 手机号登陆帮助类
|
||||
/// </summary>
|
||||
|
@ -55,11 +55,8 @@ namespace BootstrapAdmin.Web.Services.SMS
|
|||
var url = QueryHelpers.AddQueryString(Options.RequestUrl, requestParameters);
|
||||
var req = await _client.GetAsync(url);
|
||||
var content = await req.Content.ReadAsStringAsync();
|
||||
#if !NETSTANDARD2_0
|
||||
var result = JsonSerializer.Deserialize<DefaultSMSResult>(content, new JsonSerializerOptions() { PropertyNameCaseInsensitive = true });
|
||||
#else
|
||||
var result = JsonConvert.DeserializeObject<DefaultSMSResult>(content);
|
||||
#endif
|
||||
|
||||
var ret = new SMSResult() { Result = result!.Code == 1, Msg = result.Msg };
|
||||
if (ret.Result)
|
||||
{
|
||||
|
@ -123,4 +120,3 @@ namespace BootstrapAdmin.Web.Services.SMS
|
|||
/// </summary>
|
||||
public string MD5Key { get; set; } = "";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue