Procházet zdrojové kódy

Merge branch 'test' of http://110.188.24.182:10023/Fengwo/hotline into test

tangjiang před 1 týdnem
rodič
revize
d24a603025
1 změnil soubory, kde provedl 10 přidání a 2 odebrání
  1. 10 2
      src/Hotline.Api/Controllers/IdentityController.cs

+ 10 - 2
src/Hotline.Api/Controllers/IdentityController.cs

@@ -105,7 +105,15 @@ jxrWXHbT1FB6DqkdOnBbQqS1Azqz5HxLlSyEK3F60e3SgB5iZsDZ
         var request = Decrypt(dto.Signature);
         if (request is null)
             throw UserFriendlyException.SameMessage("用户名或密码错误!");
-        var res = await _identityAppService.LoginWithSignatureAsync(request, HttpContext.RequestAborted);
+        string res;
+        if (_appOptions.Value.IsLuZhou)
+        {
+            res = await _identityAppService.LoginWithSignatureAsync(request, HttpContext.RequestAborted);
+        }
+        else
+        {
+            res = await _identityAppService.LoginAsync(request, HttpContext.RequestAborted);
+        }
         request.Password = string.Empty;
         await _iSystemLogApplication.AddLog("账号登录", res, request, HttpContext, request.Username);
         return res;
@@ -215,7 +223,7 @@ jxrWXHbT1FB6DqkdOnBbQqS1Azqz5HxLlSyEK3F60e3SgB5iZsDZ
     {
         if (string.IsNullOrEmpty(signature)) return null;
         var decrypted = EncryptProvider.AESDecrypt(signature, AesKey, AesIv);
-        if(string.IsNullOrEmpty(decrypted)) return null;
+        if (string.IsNullOrEmpty(decrypted)) return null;
         return System.Text.Json.JsonSerializer.Deserialize<LoginWithSignatureRequest>(decrypted,
             JsonDefaults.DefaultJsonSerializerOptionsWithCamelCase);
     }