diff --git a/Frontend/Frontend.csproj b/Frontend/Frontend.csproj index f42ff40..04570d5 100644 --- a/Frontend/Frontend.csproj +++ b/Frontend/Frontend.csproj @@ -1,4 +1,4 @@ - + net7.0 @@ -9,6 +9,8 @@ + + diff --git a/Frontend/Pages/_Host.cshtml b/Frontend/Pages/_Host.cshtml deleted file mode 100644 index afb25f3..0000000 --- a/Frontend/Pages/_Host.cshtml +++ /dev/null @@ -1,37 +0,0 @@ -锘緻page "/" -@using Microsoft.AspNetCore.Components.Web -@namespace Frontend.Pages -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers - - - - - - - - - - - - - - -
- - An error has occurred. This application may no longer respond until reloaded. - - - An unhandled exception has occurred. See browser dev tools for details. - - Reload - 馃棛 -
- - - - - - - - - \ No newline at end of file diff --git a/Frontend/Program.cs b/Frontend/Program.cs index be620f2..62ff349 100644 --- a/Frontend/Program.cs +++ b/Frontend/Program.cs @@ -1,19 +1,15 @@ +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Katheryne; +using Frontend; -WebApplicationBuilder builder = WebApplication.CreateBuilder(args); -builder.Services.AddRazorPages(); -builder.Services.AddServerSideBlazor(); +var builder = WebAssemblyHostBuilder.CreateDefault(args); +builder.RootComponents.Add("#app"); +builder.RootComponents.Add("head::after"); builder.Services.AddAntDesign(); builder.Services.AddKatheryne(); -WebApplication app = builder.Build(); +WebAssemblyHost app = builder.Build(); -app.UseStaticFiles(); - -app.UseRouting(); - -app.MapBlazorHub(); -app.MapFallbackToPage("/_Host"); - -app.Run(); \ No newline at end of file +await app.RunAsync(); \ No newline at end of file diff --git a/Frontend/_Imports.razor b/Frontend/_Imports.razor index 628d9c2..1b80408 100644 --- a/Frontend/_Imports.razor +++ b/Frontend/_Imports.razor @@ -1,5 +1,8 @@ -锘緻using Microsoft.AspNetCore.Components.Routing +锘緻using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Components.WebAssembly.Http @using Microsoft.JSInterop @using AntDesign @using BlazorMonaco diff --git a/Frontend/wwwroot/index.html b/Frontend/wwwroot/index.html new file mode 100644 index 0000000..19a00a5 --- /dev/null +++ b/Frontend/wwwroot/index.html @@ -0,0 +1,29 @@ + + + + + + BlazorWasmSample + + + + + + + +
Loading...
+ +
+ An unhandled error has occurred. + Reload + 馃棛 +
+ + + + + + + + + \ No newline at end of file diff --git a/Katheryne/Services/KatheryneChatRobotFactory.cs b/Katheryne/Services/KatheryneChatRobotFactory.cs index 157227d..2206bbb 100644 --- a/Katheryne/Services/KatheryneChatRobotFactory.cs +++ b/Katheryne/Services/KatheryneChatRobotFactory.cs @@ -29,10 +29,10 @@ public class KatheryneChatRobotFactory } /// - /// 设置当前机器人使用的文法 + /// 璁剧疆褰撳墠鏈哄櫒浜轰娇鐢ㄧ殑鏂囨硶 /// - /// 文法字符串 - /// 编译文法失败抛出的异常 + /// 鏂囨硶瀛楃涓 + /// 缂栬瘧鏂囨硶澶辫触鎶涘嚭鐨勫紓甯 public void SetGrammar(string grammarText) { _factoryLogger.LogInformation("Receive new grammar: {}.", grammarText);