From bb9b908277ed39e1b2d64845b00644054f98e7cb Mon Sep 17 00:00:00 2001
From: z8018 <1282578289@qq.com>
Date: 星期三, 24 十二月 2025 10:04:45 +0800
Subject: [PATCH] Update ApiLogMiddleware.cs

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs"
index 921dfc3..30ffd28 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs"
@@ -124,6 +124,28 @@
             string bodyData = sr.ReadToEndAsync().Result;
             if (request.ContentLength <= 100000)
             {
+                if (context.Request.Path.Value?.ToLower().Contains("login") ?? false)
+                {
+                    Dictionary<string,object>? valuePairs = JsonConvert.DeserializeObject<Dictionary<string, object>>(bodyData);
+                    if (valuePairs != null)
+                    {
+                        if(valuePairs.ContainsKey("Password"))
+                            valuePairs["Password"] = "******";
+                        else if (valuePairs.ContainsKey("pwd"))
+                            valuePairs["pwd"] = "******";
+                        else if (valuePairs.ContainsKey("password"))
+                            valuePairs["password"] = "******";
+                        else if (valuePairs.ContainsKey("Pwd"))
+                            valuePairs["Pwd"] = "******";
+                        else if (valuePairs.ContainsKey("PASSWORD"))
+                            valuePairs["PASSWORD"] = "******";
+                        else if (valuePairs.ContainsKey("passWord"))
+                            valuePairs["passWord"] = "******";
+                        else if (valuePairs.ContainsKey("PassWord"))
+                            valuePairs["PassWord"] = "******";
+                        bodyData = JsonConvert.SerializeObject(valuePairs);
+                    }
+                }
                 obj = new
                 {
                     QueryString = request.QueryString.ToString(),

--
Gitblit v1.9.3