yuanrf 3 місяців тому
батько
коміт
31aa5dc365

+ 1 - 0
OASystem/OASystem.Api/Controllers/AuthController.cs

@@ -204,6 +204,7 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [Route("MobileLogin")]
         [HttpPost]
+        [ApiLog("Login", OperationEnum.Login)]
         [ProducesResponseType(typeof(LoginView), StatusCodes.Status200OK)]
         public async Task<IActionResult> MobileLoginAsync(LoginDto dto)
         {

+ 6 - 8
OASystem/OASystem.Api/Middlewares/RecordAPIOperationMiddleware.cs

@@ -66,8 +66,7 @@ namespace OASystem.API.Middlewares
                         bool exists5 = requestBodyJson.TryGetValue("id", out param5);
                         bool exists6 = requestBodyJson.TryGetValue("status", out param6);
 
-
-                        if (!string.IsNullOrEmpty(param1.ToString())) int.TryParse(param1.ToString(), out portType);
+                        if (exists1) int.TryParse(param1.ToString(), out portType);
 
                         
 
@@ -86,15 +85,14 @@ namespace OASystem.API.Middlewares
                             }
                             else
                             {
-                                if (int.TryParse(param2.ToString(), out userId)) { }
-                                else if (int.TryParse(param3.ToString(), out userId)) { }
-                                else if (int.TryParse(param4.ToString(), out userId)) { }
+                                if (exists2) if (int.TryParse(param2.ToString(), out userId)) { }
+                                else if (exists3) if (int.TryParse(param3.ToString(), out userId)) { }
+                                else if (exists4) if (int.TryParse(param4.ToString(), out userId)) { }
                             }
                         }
                         //编辑前数据查询;
-                        if (param5 != null) if (!string.IsNullOrEmpty(param5.ToString())) param5Bool = int.TryParse(param5.ToString(), out id);
-
-                        if (param6 != null) if (!string.IsNullOrEmpty(param6.ToString())) param6Bool = int.TryParse(param6.ToString(), out status);
+                        if (exists5) param5Bool = int.TryParse(param5.ToString(), out id);
+                        if (exists5) param6Bool = int.TryParse(param6.ToString(), out status);
 
                         if (param6Bool)
                         {