From 1b6fbcb305707c14e47ae22d67c1ded26f9a5eec Mon Sep 17 00:00:00 2001 From: liu liang Date: Thu, 8 Jun 2023 12:27:58 +0800 Subject: [PATCH] 1 --- demo/WalkingTec.Mvvm.Vue3Demo/Program.cs | 19 +++++++++++-------- .../WalkingTec.Mvvm.Vue3Demo.csproj | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/demo/WalkingTec.Mvvm.Vue3Demo/Program.cs b/demo/WalkingTec.Mvvm.Vue3Demo/Program.cs index 1f7b56854..3ec3d7274 100644 --- a/demo/WalkingTec.Mvvm.Vue3Demo/Program.cs +++ b/demo/WalkingTec.Mvvm.Vue3Demo/Program.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.SpaServices; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using VueCliMiddleware; @@ -80,17 +81,19 @@ endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); - if (app.Environment.EnvironmentName == "Development") - { - endpoints.MapToVueCliProxy( - "{*path}", - new SpaOptions { SourcePath = "ClientApp" }, - npmScript: "start", - regex: "No issues found."); - } + endpoints.MapFallbackToFile(app.Environment.IsDevelopment() ? "index_dev.html" : ""); }); + app.UseWtmContext(); +if (app.Environment.IsDevelopment()) +{ + app.UseSpa(spa => + { + spa.Options.SourcePath = "ClientApp"; + }); +} + app.Run(); public partial class Program diff --git a/demo/WalkingTec.Mvvm.Vue3Demo/WalkingTec.Mvvm.Vue3Demo.csproj b/demo/WalkingTec.Mvvm.Vue3Demo/WalkingTec.Mvvm.Vue3Demo.csproj index 72e9d2f8d..95ac7cc19 100644 --- a/demo/WalkingTec.Mvvm.Vue3Demo/WalkingTec.Mvvm.Vue3Demo.csproj +++ b/demo/WalkingTec.Mvvm.Vue3Demo/WalkingTec.Mvvm.Vue3Demo.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 InProcess true 4.5