Login()添加异常捕获

croire 3 years ago
parent dc199a4559
commit 59c75e3fdd

@ -98,26 +98,34 @@ namespace DownKyi.ViewModels
/// </summary>
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<MessageEvent>().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<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>

Loading…
Cancel
Save