From 74907784c7005b7307b690d010ce6f8292e0dc9b Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期五, 22 八月 2025 09:36:56 +0800
Subject: [PATCH] 修改单机版bug

---
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs |   27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 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_TelescopicService/MaintenanceService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs"
index 190f7f4..1c5e22f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs"
@@ -16,6 +16,8 @@
 using SqlSugar.DistributedSystem.Snowflake;
 using System.IO;
 using System.Net;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
+using WIDESEAWCS_Common;
 
 namespace WIDESEAWCS_TelescopicService
 {
@@ -259,12 +261,17 @@
                 {
                     return new WebResponseContent { Status = false, Message = "褰撳墠鐧诲綍鐢ㄦ埛鏃犳晥" };
                 }
-
-                // 3. 鏉冮檺妫�鏌ワ細褰撳墠鐢ㄦ埛鏄� admin 鎴� 褰撳墠鐢ㄦ埛鏄粍闀匡紙IsLeader == 1锛�
-                bool isAdmin = account == "admin";
+                
+                // 3. 鏉冮檺妫�鏌ワ細褰撳墠鐢ㄦ埛鏄� admin(绠$悊鍛�) 鎴� 褰撳墠鐢ㄦ埛鏄粍闀匡紙IsLeader == 1锛�
+                //bool isAdmin = account == "admin";
+                var   isState = currentUser.Role_Id=1; //妫�鏌ユ槸涓嶆槸绠$悊鍛樿鑹诧紙绠$悊鍛樿鑹睮D涓�1锛�
                 bool isLeader = currentUser.IsLeader == 1;  // 鍋囪 Sys_User 琛ㄦ湁 IsLeader 瀛楁
 
-                if (!isAdmin && !isLeader)
+                //if (!isAdmin && !isLeader)
+                //{
+                //    return new WebResponseContent { Status = false, Message = "浣犳病鏈夋潈闄愬己鍒朵笅绾�" };
+                //}
+                if (isState != 1 && !isLeader)
                 {
                     return new WebResponseContent { Status = false, Message = "浣犳病鏈夋潈闄愬己鍒朵笅绾�" };
                 }
@@ -615,13 +622,6 @@
                 var ip = LocalIP?.Replace("::ffff:", "") ?? ""; // 濡傛灉 LocalIP 鏄� null锛宨p 浼氭槸 ""
                 var address = _ipaddress.QueryData(x => x.IPaddress == ip).FirstOrDefault();
                 var addressIp = "";
-                //濡傛灉鐢ㄦ埛涓嶅湪鍘熸湰杞ㄩ亾绔欎笂缁撴潫浠诲姟锛岄偅涔堝氨鎻愮ず浠栬浠栧洖鍘�
-                if (maint.IPAddress != ip)
-                {
-                    return new WebResponseContent { Status = false, Message = "璇峰洖鍒板師鏉ョ殑杞ㄩ亾绔欑粨鏉熶换鍔�" };
-                }
-
-
                 if (maint == null || sysuer == null)
                 {
                     return new WebResponseContent { Status = false, Message = "娌℃湁鎵惧埌璇ョ敤鎴�" };
@@ -636,6 +636,11 @@
                 {
                     return new WebResponseContent { Status = false, Message = "浣犺繕娌℃湁寮�濮嬫淇紝璇峰厛鐐瑰嚮寮�濮嬫淇�" };
                 }
+                //濡傛灉鐢ㄦ埛涓嶅湪鍘熸湰杞ㄩ亾绔欎笂缁撴潫浠诲姟锛岄偅涔堝氨鎻愮ず浠栬浠栧洖
+                if (maint.IPAddress != ip)
+                {
+                    return new WebResponseContent { Status = false, Message = "璇峰洖鍒板師鏉ョ殑杞ㄩ亾绔欑粨鏉熶换鍔�" };
+                }
 
                 // 妫�鏌ユ槸鍚﹁嚦灏戞湁涓�涓粍闀垮湪鍦�
                 var activeLeaders = user.Where(x => x.IsLeader == 1 && x.MaintenanceStatus == 1).ToList();

--
Gitblit v1.9.3