李昊 4 éve
szülő
commit
242283846e

+ 8 - 3
gx_api/GxPress/Service/GxPress.Service.Implement/ApiLogService.cs

@@ -42,9 +42,14 @@ namespace GxPress.Service.Implement
             var requestBody = string.Empty;
             if (requestMethod == "POST")
             {
-                context.Request.Body.Seek(0, SeekOrigin.Begin);
-                var _reader = new StreamReader(context.Request.Body);
-                requestBody = _reader.ReadToEnd();
+                //接收从微信后台POST过来的数据
+                using (var reader = new StreamReader(context.Request.Body))
+                {
+                    requestBody = await reader.ReadToEndAsync();
+                }
+                // context.Request.Body.Seek(0, SeekOrigin.Begin);
+                // var _reader = new StreamReader(context.Request.Body);
+                // requestBody = _reader.ReadToEnd();
             }
             var model = new UserLogin
             {