From ff8f12ddc08ca4f04f0fabf464b93c56b9fa8559 Mon Sep 17 00:00:00 2001 From: oneRain Date: Wed, 13 May 2020 16:25:01 +0800 Subject: [PATCH] chore --- Storage/Storage/Internal/Http/LCHttpClient.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Storage/Storage/Internal/Http/LCHttpClient.cs b/Storage/Storage/Internal/Http/LCHttpClient.cs index af4eb76..5a4bb6a 100644 --- a/Storage/Storage/Internal/Http/LCHttpClient.cs +++ b/Storage/Storage/Internal/Http/LCHttpClient.cs @@ -61,7 +61,8 @@ namespace LeanCloud.Storage.Internal.Http { LCHttpUtils.PrintResponse(response, resultString); if (response.IsSuccessStatusCode) { - T ret = JsonConvert.DeserializeObject(resultString, new LCJsonConverter()); + T ret = JsonConvert.DeserializeObject(resultString, + LCJsonConverter.Default); return ret; } throw HandleErrorResponse(response.StatusCode, resultString); @@ -94,7 +95,8 @@ namespace LeanCloud.Storage.Internal.Http { LCHttpUtils.PrintResponse(response, resultString); if (response.IsSuccessStatusCode) { - T ret = JsonConvert.DeserializeObject(resultString, new LCJsonConverter()); + T ret = JsonConvert.DeserializeObject(resultString, + LCJsonConverter.Default); return ret; } throw HandleErrorResponse(response.StatusCode, resultString); @@ -127,7 +129,8 @@ namespace LeanCloud.Storage.Internal.Http { LCHttpUtils.PrintResponse(response, resultString); if (response.IsSuccessStatusCode) { - T ret = JsonConvert.DeserializeObject(resultString, new LCJsonConverter()); + T ret = JsonConvert.DeserializeObject(resultString, + LCJsonConverter.Default); return ret; } throw HandleErrorResponse(response.StatusCode, resultString); @@ -150,7 +153,8 @@ namespace LeanCloud.Storage.Internal.Http { LCHttpUtils.PrintResponse(response, resultString); if (response.IsSuccessStatusCode) { - Dictionary ret = JsonConvert.DeserializeObject>(resultString, new LCJsonConverter()); + Dictionary ret = JsonConvert.DeserializeObject>(resultString, + LCJsonConverter.Default); return; } throw HandleErrorResponse(response.StatusCode, resultString); @@ -161,7 +165,8 @@ namespace LeanCloud.Storage.Internal.Http { string message = responseContent; try { // 尝试获取 LeanCloud 返回错误信息 - Dictionary error = JsonConvert.DeserializeObject>(responseContent, new LCJsonConverter()); + Dictionary error = JsonConvert.DeserializeObject>(responseContent, + LCJsonConverter.Default); code = (int)error["code"]; message = error["error"].ToString(); } catch (Exception e) {