基于WebView2实现的Win11桌面框架,利用插件自定义
chunhualin1
2026-08-14 b84db8983d63a9a981083ebce1a139860c6bdf25
src/Moli.Desktop/WebView/PluginBridgeDispatcher.cs
@@ -1,3 +1,4 @@
using System.Net.Http;
using System.Text.Json;
using Moli.Desktop.Diagnostics;
using Moli.Desktop.Llm;
@@ -118,9 +119,14 @@
            var projects = await _llmGateway.GetProjectsAsync(ReadRuntimeConfig(context), cancellationToken).ConfigureAwait(false);
            return PluginBridgeResponse.Ok(request.Id ?? string.Empty, projects);
        }
        catch (AiChatClientException ex)
        catch (Exception ex) when (ex is AiChatClientException or HttpRequestException)
        {
            return PluginBridgeResponse.Failure(request.Id, ex.Code, ex.Message);
            return PluginBridgeResponse.Ok(request.Id ?? string.Empty, new AiChatProjectsResult
            {
                Status = AiChatProjectStatuses.NotConnected,
                Message = ex.Message,
                Projects = []
            });
        }
    }