bklLiudl
2024-07-11 d7a149dc1b2c7a658ff2e3856186dc349dcf3329
Wms/Utility/Filter/CustomerExceptionMiddleware.cs
@@ -7,6 +7,7 @@
using Microsoft.Extensions.Logging;
using Utility.Entity;
using Newtonsoft.Json;
using System.Text;
namespace Utility
{
@@ -40,8 +41,10 @@
                        message: result,
                        data: result
                    );
                await context.Response.WriteAsync(JsonConvert.SerializeObject(apiResponse));
                var json = JsonConvert.SerializeObject(apiResponse);
                context.Response.ContentType = "application/json";
                context.Response.ContentLength = Encoding.UTF8.GetByteCount(json);
                await context.Response.WriteAsync(json);
            }
        }
    }