弹窗消息在SignalR订阅方法中需InvokeAsync

This commit is contained in:
2248356998 qq.com
2023-04-03 13:35:14 +08:00
parent 6445281658
commit 4801db9050

View File

@@ -51,7 +51,14 @@ namespace ThingsGateway.Web.Rcl
).Build();
_hubConnection.On<object>("LoginOut", async (message) =>
{
await PopupService.EnqueueSnackbarAsync(message.ToString(), AlertTypes.Warning);
try
{
await InvokeAsync(() => PopupService.EnqueueSnackbarAsync(message.ToString(), AlertTypes.Warning));
}
catch (Exception ex)
{
}
await Task.Delay(2000);
await AjaxService.Goto("/");
});