Skip to content

Commit

Permalink
Desktop将登陆过期提示修改为消息提示而非强制弹窗
Browse files Browse the repository at this point in the history
  • Loading branch information
CHKZL committed Jul 3, 2024
1 parent 1c5c561 commit 1b63ac9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Core/Init.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private static void StartParameterInitialization(string[] args)


/// <summary>
/// 获取Core初始化完成后的运行毫秒数
/// 获取Core初始化完成后的运行秒数
/// </summary>
/// <returns></returns>
public static double GetRunTime()
Expand Down
13 changes: 10 additions & 3 deletions Desktop/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void Init()
Detect.detectRoom.LiveStart += DetectRoom_LiveStart;
//初始化VLC播放器组件
LibVLCSharp.Shared.Core.Initialize("./plugins/vlc");

}

private void InitializeTitleMode()
Expand Down Expand Up @@ -303,8 +303,15 @@ private void LoginStatus_LoginFailureEvent(object? sender, EventArgs e)
DataSource.LoginStatus.LoginWindowDisplayStatus = true;
Dispatcher.Invoke(() =>
{
QrLogin qrLogin = new QrLogin();
qrLogin.ShowDialog();
if (Core.Init.GetRunTime() < 90)
{
QrLogin qrLogin = new QrLogin();
qrLogin.ShowDialog();
}
else
{
MainWindow.SnackbarService.Show("登录态检查失败", $"检查账号信息的登陆状态有效性失败,该提示一般是由于登录态已过期造成的(如账号在其他地方登陆过多,异地登录等触发风控),也有可能是网络不稳定造成,如果频繁提示或者录制失败请尝试重新登陆,重新登陆请到设置-登录态管理中进行", ControlAppearance.Primary, new SymbolIcon(SymbolRegular.CloudError20), TimeSpan.FromSeconds(30));
}
});

}
Expand Down
2 changes: 1 addition & 1 deletion Desktop/Views/Windows/VlcPlayWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ private void AddDanmu(string DanmuText, bool IsSubtitle, long uid = 0)
break;
}
}
double b = Core.Init.GetRunTime();
danMuOrbitInfos[Index].Time = (int)(Init.GetRunTime() + 5);
//非UI线程调用UI组件
System.Windows.Application.Current.Dispatcher.Invoke(async () =>
Expand Down

0 comments on commit 1b63ac9

Please sign in to comment.