diff --git a/src/admin/Bootstrap.DataAccess/Helper/SMSHelper.cs b/src/admin/Bootstrap.DataAccess/Helper/SMSHelper.cs index e76fb953..55cfc284 100644 --- a/src/admin/Bootstrap.DataAccess/Helper/SMSHelper.cs +++ b/src/admin/Bootstrap.DataAccess/Helper/SMSHelper.cs @@ -44,15 +44,12 @@ namespace Bootstrap.DataAccess var req = await client.GetAsync(url); var content = await req.Content.ReadAsStringAsync(); #if NETCOREAPP3_0 - var result = JsonSerializer.Deserialize(content, new JsonSerializerOptions() - { - PropertyNameCaseInsensitive = true - }); + var result = JsonSerializer.Deserialize(content); #else var result = JsonConvert.DeserializeObject(content, new JsonSerializerSettings() { ContractResolver = new DefaultContractResolver() }); #endif var ret = false; - if (result.Code == "1") + if (result.Code == 1) { _pool.AddOrUpdate(option.Phone, key => new AutoExpireValidateCode(option.Phone, result.Data, option.Expires), (key, v) => v.Reset(result.Data)); ret = true; @@ -95,7 +92,7 @@ namespace Bootstrap.DataAccess private class SMSResult { - public string Code { get; set; } + public int Code { get; set; } public string Data { get; set; } }