From 59c75e3fdd677a63818a01c5df1452e2bda03d52 Mon Sep 17 00:00:00 2001 From: croire <1432593898@qq.com> Date: Sat, 19 Mar 2022 20:06:29 +0800 Subject: [PATCH] =?UTF-8?q?Login()=E6=B7=BB=E5=8A=A0=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=8D=95=E8=8E=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DownKyi/ViewModels/ViewLoginViewModel.cs | 40 ++++++++++++++---------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/DownKyi/ViewModels/ViewLoginViewModel.cs b/DownKyi/ViewModels/ViewLoginViewModel.cs index 6767e83..4b89904 100644 --- a/DownKyi/ViewModels/ViewLoginViewModel.cs +++ b/DownKyi/ViewModels/ViewLoginViewModel.cs @@ -98,26 +98,34 @@ namespace DownKyi.ViewModels /// private void Login() { - var loginUrl = LoginQR.GetLoginUrl(); - if (loginUrl == null) { return; } - - if (loginUrl.Status != true) + try { - ExecuteBackSpace(); - return; - } + var loginUrl = LoginQR.GetLoginUrl(); + if (loginUrl == null) { return; } - if (loginUrl.Data == null || loginUrl.Data.Url == null) - { - eventAggregator.GetEvent().Publish(DictionaryResource.GetString("GetLoginUrlFailed")); - return; - } + if (loginUrl.Status != true) + { + ExecuteBackSpace(); + return; + } - PropertyChangeAsync(new Action(() => { LoginQRCode = LoginQR.GetLoginQRCode(loginUrl.Data.Url); })); - Core.Utils.Debugging.Console.PrintLine(loginUrl.Data.Url + "\n"); - LogManager.Debug(Tag, loginUrl.Data.Url); + if (loginUrl.Data == null || loginUrl.Data.Url == null) + { + eventAggregator.GetEvent().Publish(DictionaryResource.GetString("GetLoginUrlFailed")); + return; + } + + PropertyChangeAsync(new Action(() => { LoginQRCode = LoginQR.GetLoginQRCode(loginUrl.Data.Url); })); + Core.Utils.Debugging.Console.PrintLine(loginUrl.Data.Url + "\n"); + LogManager.Debug(Tag, loginUrl.Data.Url); - GetLoginStatus(loginUrl.Data.OauthKey); + GetLoginStatus(loginUrl.Data.OauthKey); + } + catch (Exception e) + { + Core.Utils.Debugging.Console.PrintLine("Login()发生异常: {0}", e); + LogManager.Error(Tag, e); + } } ///