From 6a50daac547ebaf0c2503803626e12fbc63c0bb6 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期四, 28 八月 2025 10:13:45 +0800
Subject: [PATCH] 修改密码的复杂度

---
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_CustomIPaddress.cs               |    2 
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Telescopic/ParametersController.cs       |    2 
 项目代码/后端/后台管理/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.12.38.29086/CodeChunks.db-shm |    0 
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Telescopic/MaintenanceController.cs      |    2 
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_Maintenance.cs                   |    2 
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SSG/AlarmResetJob.cs                                  |    1 
 项目代码/后端/后台管理/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs                          |   58 ++++++++++++++++---
 项目代码/后端/后台管理/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.12.38.29086/CodeChunks.db-wal |    0 
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs                           |   60 ++++++++++++++++---
 9 files changed, 103 insertions(+), 24 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_CustomIPaddress.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_CustomIPaddress.cs"
index cdd3eeb..7e35819 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_CustomIPaddress.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_CustomIPaddress.cs"
@@ -15,7 +15,7 @@
         [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
         public  int  ID { get; set; }
 
-        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "IP鍦板潃")]
+        [SugarColumn(IsNullable = true,ColumnDescription = "IP鍦板潃")]
         public string  IPaddress { get; set; }
 
         [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鑷畾涔塱p鍦板潃鐨勪腑鏂囧悕瀛�")]
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_Maintenance.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_Maintenance.cs"
index 83568fa..251c91d 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_Maintenance.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_Maintenance.cs"
@@ -56,7 +56,7 @@
         public int MaintenanceStatus{ get; set; }
 
 
-        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "杞ㄩ亾绔欎笓灞瀒d")]
+        [SugarColumn(IsNullable = true, ColumnDescription = "杞ㄩ亾绔欎笓灞瀒d")]
         public int? StationID { get; set; }
 
         /// <summary>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Telescopic/MaintenanceController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Telescopic/MaintenanceController.cs"
index 21514e0..69b5788 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Telescopic/MaintenanceController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Telescopic/MaintenanceController.cs"
@@ -120,7 +120,7 @@
         {
             var userIp = HttpContext.GetUserIp();//鐢ㄦ埛鐢佃剳ip
             var reslut = userIp.Replace("::ffff:","");
-            return Service.StopMaintenanceTask(account, userIp);
+            return Service.StopMaintenanceTask(account, reslut);
         }
 
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Telescopic/ParametersController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Telescopic/ParametersController.cs"
index e7afb15..aac974f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Telescopic/ParametersController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Telescopic/ParametersController.cs"
@@ -15,6 +15,7 @@
     [ApiController]
     public class ParametersController : ApiBaseController<IParametersService, Dt_Parameters>
     {
+
         public ParametersController(IParametersService service) : base(service)
         {
 
@@ -29,6 +30,7 @@
         [HttpPost, Route("ManualOperation")]
         public  WebResponseContent ManualOperation(string position, string ExtendedState)
         {
+          
             var userIp = HttpContext.GetUserIp();//鐢ㄦ埛鐢佃剳ip
             var reslut = userIp.Replace("::ffff:", "");
             return Service.ManualOperation(position, ExtendedState, reslut);
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs"
index d9ddf8c..5b2e79f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs"
@@ -14,6 +14,7 @@
 using Microsoft.AspNetCore.Http;
 using Newtonsoft.Json;
 using WIDESEAWCS_Common;
+
 using FaceAI;
 using System.Runtime.InteropServices;
 using System.IO;
@@ -365,9 +366,26 @@
                 if (string.IsNullOrEmpty(oldPwd)) return WebResponseContent.Instance.Error("鏃у瘑鐮佷笉鑳戒负绌�");
                 if (string.IsNullOrEmpty(newPwd)) return WebResponseContent.Instance.Error("鏂板瘑鐮佷笉鑳戒负绌�");
                 if (newPwd.Length < 6) return WebResponseContent.Instance.Error("瀵嗙爜涓嶈兘灏戜簬6浣�");
+               
 
                 int userId = App.User.UserId;
                 string userCurrentPwd = BaseDal.QueryFirst(x => x.User_Id == userId, s => s.UserPwd);
+
+                // 鉁� 瀵嗙爜澶嶆潅搴︽牎楠岋細蹇呴』鍖呭惈瀛楁瘝鍜屾暟瀛�
+                // 鉁� 瀵嗙爜澶嶆潅搴︽牎楠岋細蹇呴』鍖呭惈澶у皬鍐欏瓧姣嶃�佹暟瀛楀拰鐗规畩绗﹀彿
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"[a-z]"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚皬鍐欏瓧姣�");
+
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"[A-Z]"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚ぇ鍐欏瓧姣�");
+
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"\d"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚暟瀛�");
+
+                // 鉁� 瀵嗙爜澶嶆潅搴︽牎楠岋細蹇呴』鍖呭惈鑷冲皯涓�涓壒娈婄鍙凤紙闈炲瓧姣嶆暟瀛楃殑閮界畻锛�
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"[^a-zA-Z0-9]"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚嚦灏戜竴涓壒娈婄鍙�");
+
 
                 string _oldPwd = oldPwd.EncryptDES(AppSecret.User);
                 if (_oldPwd != userCurrentPwd) return WebResponseContent.Instance.Error("鏃у瘑鐮佷笉姝g‘");
@@ -403,7 +421,7 @@
         /// <param name="id"></param>
         /// <param name="oldPwd"></param>
         /// <param name="newPwd"></param>
-        /// <returns></returns>
+        /// <returns></returns>   
         public WebResponseContent UpdatePwd(int id, string oldPwd, string newPwd)
         {
             WebResponseContent content = new WebResponseContent();
@@ -412,22 +430,44 @@
 
             try
             {
-                if (string.IsNullOrEmpty(oldPwd)) return content.Error("鏃у瘑鐮佷笉鑳戒负绌�");
-                if (string.IsNullOrEmpty(newPwd)) return content.Error("鏂板瘑鐮佷笉鑳戒负绌�");
-                if (newPwd.Length < 6) return content.Error("瀵嗙爜涓嶈兘灏戜簬6浣�");
+                if (string.IsNullOrEmpty(oldPwd))
+                    return content.Error("鏃у瘑鐮佷笉鑳戒负绌�");
+
+                if (string.IsNullOrEmpty(newPwd))
+                    return content.Error("鏂板瘑鐮佷笉鑳戒负绌�");
+
+                if (newPwd.Length < 6)
+                    return content.Error("瀵嗙爜涓嶈兘灏戜簬6浣�");
+
+                // 鉁� 瀵嗙爜澶嶆潅搴︽牎楠岋細蹇呴』鍖呭惈澶у皬鍐欏瓧姣嶃�佹暟瀛楀拰鐗规畩绗﹀彿
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"[a-z]"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚皬鍐欏瓧姣�");
+
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"[A-Z]"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚ぇ鍐欏瓧姣�");
+
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"\d"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚暟瀛�");
+
+                // 鉁� 瀵嗙爜澶嶆潅搴︽牎楠岋細蹇呴』鍖呭惈鑷冲皯涓�涓壒娈婄鍙凤紙闈炲瓧姣嶆暟瀛楃殑閮界畻锛�
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"[^a-zA-Z0-9]"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚嚦灏戜竴涓壒娈婄鍙�");
 
                 // 鑾峰彇鐢ㄦ埛褰撳墠瀵嗙爜
                 string userCurrentPwd = BaseDal.QueryFirst(x => x.User_Id == id, s => s.UserPwd) ?? "";
 
-                if (string.IsNullOrEmpty(userCurrentPwd)) return content.Error("鐢ㄦ埛涓嶅瓨鍦ㄦ垨瀵嗙爜鏈缃�");
+                if (string.IsNullOrEmpty(userCurrentPwd))
+                    return content.Error("鐢ㄦ埛涓嶅瓨鍦ㄦ垨瀵嗙爜鏈缃�");
 
-                //// 杩涜瀵嗙爜鍔犲瘑瀵规瘮
+                //// 濡傛灉闇�瑕侀獙璇佹棫瀵嗙爜锛屾斁寮�杩欓噷
                 //string _oldPwd = oldPwd.EncryptDES(AppSecret.User);
-                //if (_oldPwd != userCurrentPwd) return content.Error("鏃у瘑鐮佷笉姝g‘");
+                //if (_oldPwd != userCurrentPwd) 
+                //    return content.Error("鏃у瘑鐮佷笉姝g‘");
 
                 // 鐢熸垚鏂板瘑鐮佸姞瀵嗗��
                 string _newPwd = newPwd.EncryptDES(AppSecret.User);
-                if (userCurrentPwd == _newPwd) return content.Error("鏂板瘑鐮佷笉鑳戒笌鏃у瘑鐮佺浉鍚�");
+                if (userCurrentPwd == _newPwd)
+                    return content.Error("鏂板瘑鐮佷笉鑳戒笌鏃у瘑鐮佺浉鍚�");
 
                 // 鏇存柊瀵嗙爜
                 bool isUpdated = BaseDal.UpdateData(new Sys_User
@@ -443,7 +483,7 @@
 
                 if (!isUpdated)
                 {
-                    return content.Error("瀵嗙爜淇敼澶辫触锛岃绋嶅悗閲嶈瘯");
+                    return content.Error("瀵嗙爜淇敼澶辫触锛屽瘑鐮佸繀椤诲寘鎷瓧姣嶄互鍙婄壒娈婂瓧绗�");
                 }
 
                 return content.OK("瀵嗙爜淇敼鎴愬姛", id);
@@ -570,7 +610,7 @@
                     RoleName = addUserDTO.rolename,
                     Enable = addUserDTO.enable,
                     Unit=addUserDTO.userunit,
-                    UserPwd = "j79rYYvCz4vdhcboB1Ausg==",
+                    UserPwd = "NgKc7vI5u5jzh115fowV~g==",
                     Userteam=addUserDTO.userteam,
                     Dept_Id=addUserDTO.dept_Id,
                     //CardNumber=addUserDTO.carnuber,
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SSG/AlarmResetJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SSG/AlarmResetJob.cs"
index 7d3f56a..3cad967 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SSG/AlarmResetJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SSG/AlarmResetJob.cs"
@@ -87,7 +87,6 @@
                         //var devices = GetDevicesByDeptId(deid);
 
 
-
                         if (devices != null)
                         {
                             // Left PLC processing
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.12.38.29086/CodeChunks.db-shm" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.12.38.29086/CodeChunks.db-shm"
new file mode 100644
index 0000000..50c5e0f
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.12.38.29086/CodeChunks.db-shm"
Binary files differ
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.12.38.29086/CodeChunks.db-wal" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.12.38.29086/CodeChunks.db-wal"
new file mode 100644
index 0000000..616808c
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.12.38.29086/CodeChunks.db-wal"
Binary files differ
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs"
index 400d8ea..65b4442 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs"
@@ -306,7 +306,7 @@
 
         public override WebResponseContent AddData(SaveModel saveModel)
         {
-            string pwd = "123456";
+            string pwd = "Gns1234+";
             string uesrName = saveModel.MainData[nameof(Sys_User.UserName).FirstLetterToLower()].ToString();
             saveModel.MainData[nameof(Sys_User.UserPwd).FirstLetterToLower()] = pwd.EncryptDES(AppSecret.User);
 
@@ -360,6 +360,20 @@
                 if (string.IsNullOrEmpty(newPwd)) return WebResponseContent.Instance.Error("鏂板瘑鐮佷笉鑳戒负绌�");
                 if (newPwd.Length < 6) return WebResponseContent.Instance.Error("瀵嗙爜涓嶈兘灏戜簬6浣�");
 
+                // 鉁� 瀵嗙爜澶嶆潅搴︽牎楠岋細蹇呴』鍖呭惈澶у皬鍐欏瓧姣嶃�佹暟瀛楀拰鐗规畩绗﹀彿
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"[a-z]"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚皬鍐欏瓧姣�");
+
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"[A-Z]"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚ぇ鍐欏瓧姣�");
+
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"\d"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚暟瀛�");
+
+                // 鐗规畩绗﹀彿锛堟爣鐐癸級锛屾瘮濡� . ! @ # $ % ^ & * ( ) _ - + = ...
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"[!@#$%^&*(),.?""':{}|<>_\-+=\\/\[\]~`]"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚嚦灏戜竴涓壒娈婄鍙�");
+
                 int userId = App.User.UserId;
                 string userCurrentPwd = BaseDal.QueryFirst(x => x.User_Id == userId, s => s.UserPwd);
 
@@ -406,22 +420,45 @@
 
             try
             {
-                if (string.IsNullOrEmpty(oldPwd)) return content.Error("鏃у瘑鐮佷笉鑳戒负绌�");
-                if (string.IsNullOrEmpty(newPwd)) return content.Error("鏂板瘑鐮佷笉鑳戒负绌�");
-                if (newPwd.Length < 6) return content.Error("瀵嗙爜涓嶈兘灏戜簬6浣�");
+                if (string.IsNullOrEmpty(oldPwd))
+                    return content.Error("鏃у瘑鐮佷笉鑳戒负绌�");
+
+                if (string.IsNullOrEmpty(newPwd))
+                    return content.Error("鏂板瘑鐮佷笉鑳戒负绌�");
+
+                if (newPwd.Length < 6)
+                    return content.Error("瀵嗙爜涓嶈兘灏戜簬6浣�");
+
+                // 鉁� 瀵嗙爜澶嶆潅搴︽牎楠岋細蹇呴』鍖呭惈澶у皬鍐欏瓧姣嶃�佹暟瀛楀拰鐗规畩绗﹀彿
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"[a-z]"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚皬鍐欏瓧姣�");
+
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"[A-Z]"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚ぇ鍐欏瓧姣�");
+
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"\d"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚暟瀛�");
+
+                // 鐗规畩绗﹀彿锛堟爣鐐癸級锛屾瘮濡� . ! @ # $ % ^ & * ( ) _ - + = ...
+                if (!global::System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"[^a-zA-Z0-9]"))
+                    return content.Error("鏂板瘑鐮佸繀椤诲寘鍚嚦灏戜竴涓壒娈婄鍙�");
+
 
                 // 鑾峰彇鐢ㄦ埛褰撳墠瀵嗙爜
                 string userCurrentPwd = BaseDal.QueryFirst(x => x.User_Id == id, s => s.UserPwd) ?? "";
 
-                if (string.IsNullOrEmpty(userCurrentPwd)) return content.Error("鐢ㄦ埛涓嶅瓨鍦ㄦ垨瀵嗙爜鏈缃�");
+                if (string.IsNullOrEmpty(userCurrentPwd))
+                    return content.Error("鐢ㄦ埛涓嶅瓨鍦ㄦ垨瀵嗙爜鏈缃�");
 
-                //// 杩涜瀵嗙爜鍔犲瘑瀵规瘮
+                //// 濡傛灉闇�瑕侀獙璇佹棫瀵嗙爜锛屾斁寮�杩欓噷
                 //string _oldPwd = oldPwd.EncryptDES(AppSecret.User);
-                //if (_oldPwd != userCurrentPwd) return content.Error("鏃у瘑鐮佷笉姝g‘");
+                //if (_oldPwd != userCurrentPwd) 
+                //    return content.Error("鏃у瘑鐮佷笉姝g‘");
 
                 // 鐢熸垚鏂板瘑鐮佸姞瀵嗗��
                 string _newPwd = newPwd.EncryptDES(AppSecret.User);
-                if (userCurrentPwd == _newPwd) return content.Error("鏂板瘑鐮佷笉鑳戒笌鏃у瘑鐮佺浉鍚�");
+                if (userCurrentPwd == _newPwd)
+                    return content.Error("鏂板瘑鐮佷笉鑳戒笌鏃у瘑鐮佺浉鍚�");
 
                 // 鏇存柊瀵嗙爜
                 bool isUpdated = BaseDal.UpdateData(new Sys_User
@@ -437,7 +474,7 @@
 
                 if (!isUpdated)
                 {
-                    return content.Error("瀵嗙爜淇敼澶辫触锛岃绋嶅悗閲嶈瘯");
+                    return content.Error("瀵嗙爜淇敼澶辫触锛屽瘑鐮佸繀椤诲寘鎷瓧姣嶄互鍙婄壒娈婂瓧绗�");
                 }
 
                 return content.OK("瀵嗙爜淇敼鎴愬姛", id);
@@ -448,6 +485,7 @@
                 return content.Error($"鏈嶅姟鍣ㄩ敊璇�: {ex.Message}");
             }
         }
+
 
 
         public WebResponseContent Upuserbase(UserDTO userDTO)
@@ -564,7 +602,7 @@
                     RoleName = addUserDTO.rolename,
                     Enable = addUserDTO.enable,
                     Unit = addUserDTO.userunit,
-                    UserPwd = "j79rYYvCz4vdhcboB1Ausg==",
+                    UserPwd = "NgKc7vI5u5jzh115fowV~g==",
                     Userteam = addUserDTO.userteam,
                     Dept_Id = addUserDTO.dept_Id,
                     //CardNumber=addUserDTO.carnuber,

--
Gitblit v1.9.3