From f3e54038181208a96e943b91badc1bb6c8405a1f Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 4 Oct 2019 00:12:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(#I12XVH):=20=E6=89=8B=E6=9C=BA=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=94=AF=E6=8C=81=20System.Text.Json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #Issue link #I12XVH --- src/admin/Bootstrap.DataAccess/Helper/SMSHelper.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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; } }