UpdateUserInfo()添加异常捕获

croire 3 years ago
parent 73b2fa9739
commit 796be050a5

@ -227,19 +227,19 @@ namespace DownKyi.ViewModels
/// </summary> /// </summary>
private async void UpdateUserInfo() private async void UpdateUserInfo()
{ {
LoginPanelVisibility = Visibility.Hidden;
// 检查本地是否存在login文件没有则说明未登录
if (!File.Exists(StorageManager.GetLogin()))
{
LoginPanelVisibility = Visibility.Visible;
Header = new BitmapImage(new Uri("pack://application:,,,/Resources/default_header.jpg"));
UserName = null;
return;
}
try try
{ {
LoginPanelVisibility = Visibility.Hidden;
// 检查本地是否存在login文件没有则说明未登录
if (!File.Exists(StorageManager.GetLogin()))
{
LoginPanelVisibility = Visibility.Visible;
Header = new BitmapImage(new Uri("pack://application:,,,/Resources/default_header.jpg"));
UserName = null;
return;
}
await Task.Run(new Action(() => await Task.Run(new Action(() =>
{ {
// 获取用户信息 // 获取用户信息

Loading…
Cancel
Save