From be0856c1bf533ed6001ff786908ae98e4b853eb5 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 09 一月 2025 10:09:02 +0800
Subject: [PATCH] 1

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs"
index d9033aa..8345af4 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs"
@@ -2,12 +2,14 @@
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Caching.Memory;
+using Newtonsoft.Json;
 using StackExchange.Profiling;
 using WIDESEA_Core;
 using WIDESEA_Core.Authorization;
 using WIDESEA_Core.BaseController;
 using WIDESEA_Core.Caches;
 using WIDESEA_Core.Const;
+using WIDESEA_Core.Extensions;
 using WIDESEA_Core.Helper;
 using WIDESEA_Core.HttpContextUser;
 using WIDESEA_Core.Utilities;
@@ -37,6 +39,30 @@
         public IActionResult Login([FromBody] LoginInfo loginInfo)
         {
             return Json(Service.Login(loginInfo));
+        }
+
+        [HttpPost, Route("swgLogin"), AllowAnonymous]
+        public dynamic SwgLogin([FromBody] SwaggerLoginRequest loginRequest)
+        {
+            if (loginRequest is null)
+            {
+                return new { result = false };
+            }
+
+            try
+            {
+                if (loginRequest.name == "admin" && loginRequest.pwd == $"admin!{DateTime.Now.ToString("yyyyMMdd")}")
+                {
+                    HttpContext.SuccessSwagger();
+                    return new { result = true };
+                }
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+            return new { result = false };
         }
 
         [HttpPost, Route("getCurrentUserInfo")]
@@ -98,4 +124,10 @@
 
         }
     }
+
+    public class SwaggerLoginRequest
+    {
+        public string name { get; set; }
+        public string pwd { get; set; }
+    }
 }

--
Gitblit v1.9.3