From 378d7849afde29a36f121d2c18b39511efe4293f Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期五, 13 三月 2026 16:30:29 +0800
Subject: [PATCH] 1
---
WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs b/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs
index 4d1ac2b..c03ad9c 100644
--- a/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs
+++ b/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs
@@ -3,11 +3,13 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
+using Newtonsoft.Json;
using StackExchange.Profiling;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Authorization;
using WIDESEAWCS_Core.BaseController;
using WIDESEAWCS_Core.Const;
+using WIDESEAWCS_Core.Extensions;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.HttpContextUser;
using WIDESEAWCS_Core.Utilities;
@@ -26,6 +28,30 @@
public Sys_UserController(ISys_UserService userService, IHttpContextAccessor httpContextAccessor) : base(userService)
{
_httpContextAccessor = httpContextAccessor;
+ }
+
+ [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("login"), AllowAnonymous]
@@ -91,4 +117,10 @@
}
}
+
+ public class SwaggerLoginRequest
+ {
+ public string name { get; set; }
+ public string pwd { get; set; }
+ }
}
--
Gitblit v1.9.3