Login()添加异常捕获

croire 3 years ago
parent dc199a4559
commit 59c75e3fdd

@ -98,26 +98,34 @@ namespace DownKyi.ViewModels
/// </summary> /// </summary>
private void Login() private void Login()
{ {
var loginUrl = LoginQR.GetLoginUrl(); try
if (loginUrl == null) { return; }
if (loginUrl.Status != true)
{ {
ExecuteBackSpace(); var loginUrl = LoginQR.GetLoginUrl();
return; if (loginUrl == null) { return; }
}
if (loginUrl.Data == null || loginUrl.Data.Url == null) if (loginUrl.Status != true)
{ {
eventAggregator.GetEvent<MessageEvent>().Publish(DictionaryResource.GetString("GetLoginUrlFailed")); ExecuteBackSpace();
return; return;
} }
PropertyChangeAsync(new Action(() => { LoginQRCode = LoginQR.GetLoginQRCode(loginUrl.Data.Url); })); if (loginUrl.Data == null || loginUrl.Data.Url == null)
Core.Utils.Debugging.Console.PrintLine(loginUrl.Data.Url + "\n"); {
LogManager.Debug(Tag, loginUrl.Data.Url); eventAggregator.GetEvent<MessageEvent>().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);
}
} }
/// <summary> /// <summary>

Loading…
Cancel
Save