Эх сурвалжийг харах

🏹修复密码解密报错问题#I9JQCI

Signed-off-by: KaneLeung <kk.xiaolan@gmail.com>
KaneLeung 1 жил өмнө
parent
commit
0eb70a7b9b

+ 8 - 1
Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs

@@ -90,7 +90,14 @@ public class SysAuthService : IDynamicApiController, ITransient
             throw Oops.Oh(ErrorCodeEnum.Z1003);
 
         // 国密SM2解密(前端密码传输SM2加密后的)
-        input.Password = CryptogramUtil.SM2Decrypt(input.Password);
+        try
+        {
+            input.Password = CryptogramUtil.SM2Decrypt(input.Password);
+        }
+        catch
+        {
+            throw Oops.Oh(ErrorCodeEnum.D1000);
+        }
 
         // 是否开启域登录验证
         if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysDomainLogin))