From 9b1c885f69ef616e869d518384758441355bafff Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sun, 11 Jan 2026 00:22:15 +0800 Subject: [PATCH 1/2] fix add admin validation logic. --- .../SystemManagement/Administrator/AdminService.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/EOM.TSHotelManagement.Service/SystemManagement/Administrator/AdminService.cs b/EOM.TSHotelManagement.Service/SystemManagement/Administrator/AdminService.cs index 43e3237..3388b62 100644 --- a/EOM.TSHotelManagement.Service/SystemManagement/Administrator/AdminService.cs +++ b/EOM.TSHotelManagement.Service/SystemManagement/Administrator/AdminService.cs @@ -228,11 +228,15 @@ namespace EOM.TSHotelManagement.Service { try { - var haveSuperAdmin = adminRepository.IsAny(a => a.IsSuperAdmin == 1 && a.IsDelete != 1); - if (haveSuperAdmin) + if (createAdministratorInputDto.IsSuperAdmin == 1) { - return new BaseResponse { Message = LocalizationHelper.GetLocalizedString("Super Administrator already exists", "超级管理员已存在"), Code = BusinessStatusCode.InternalServerError }; + var haveSuperAdmin = adminRepository.IsAny(a => a.IsSuperAdmin == 1 && a.IsDelete != 1); + if (haveSuperAdmin) + { + return new BaseResponse { Message = LocalizationHelper.GetLocalizedString("Super Administrator already exists", "超级管理员已存在"), Code = BusinessStatusCode.InternalServerError }; + } } + var haveAdmin = adminRepository.IsAny(a => a.Account == createAdministratorInputDto.Account); if (haveAdmin) { -- Gitee From 1dba5a79b97fc0c063322a56b38e04a1275dcb5d Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sun, 11 Jan 2026 00:22:35 +0800 Subject: [PATCH 2/2] update version.txt --- version.txt | Bin 18 -> 18 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/version.txt b/version.txt index e7b2a522c42f4bb70e24cf02502fc0945fc592cd..5dd7646c1621f86363ec6a00d00c5d3965f488fd 100644 GIT binary patch literal 18 WcmezW&xk>f0fY@1j2Uf0fY^KBrgLO0{}0g12_Nx -- Gitee