李昊 4 年之前
父節點
當前提交
7af3b0eb4b
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      GxPress/Repository/GxPress.Repository.Implement/UserRepository.cs

+ 2 - 1
GxPress/Repository/GxPress.Repository.Implement/UserRepository.cs

@@ -649,7 +649,8 @@ namespace GxPress.Repository.Implement
             try
             {
                 var imServiceUrl = ConfigHelper.GetValue("ServiceAddress:ImUrl");
-                HttpClient httpClient = new HttpClient(); //http对象
+                var httpClientHandler=new HttpClientHandler{ServerCertificateCustomValidationCallback=HttpClientHandler.DangerousAcceptAnyServerCertificateValidator};
+                HttpClient httpClient = new HttpClient(httpClientHandler); //http对象
                 HttpResponseMessage response = await httpClient.PostAsync(
                     $"{imServiceUrl}/users",
                     new JsonContent(new { username = request.Phone, password = "123456", nickname = request.Name }));