diff --git a/Sinet.Universal.Admin.sln b/Sinet.Universal.Admin.sln index 2ef8163..bbfe62a 100644 --- a/Sinet.Universal.Admin.sln +++ b/Sinet.Universal.Admin.sln @@ -49,6 +49,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sinet.Universal.Admin.Web", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sinet.Universal.Admin.RCL", "src\common\Sinet.Universal.Admin.RCL\Sinet.Universal.Admin.RCL.csproj", "{1292B265-A3F8-480A-B63E-BE7DA3F9C981}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sinet.Universal.Admin.Client", "src\client\Sinet.Universal.Admin.Client\Sinet.Universal.Admin.Client.csproj", "{0294B2C3-07EF-45BD-843F-A3AD0FA8B8A0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -127,6 +129,10 @@ Global {1292B265-A3F8-480A-B63E-BE7DA3F9C981}.Debug|Any CPU.Build.0 = Debug|Any CPU {1292B265-A3F8-480A-B63E-BE7DA3F9C981}.Release|Any CPU.ActiveCfg = Release|Any CPU {1292B265-A3F8-480A-B63E-BE7DA3F9C981}.Release|Any CPU.Build.0 = Release|Any CPU + {0294B2C3-07EF-45BD-843F-A3AD0FA8B8A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0294B2C3-07EF-45BD-843F-A3AD0FA8B8A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0294B2C3-07EF-45BD-843F-A3AD0FA8B8A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0294B2C3-07EF-45BD-843F-A3AD0FA8B8A0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -153,6 +159,7 @@ Global {CEBD131C-0B70-4BBF-99C5-47E2EB415554} = {CA3CC1A0-79B8-4B7B-8180-9A355B3856F7} {6C032DF5-C957-468F-A4C9-CA8167508DEF} = {15E62D85-34D1-44EE-9C43-AD3CC8D8558D} {1292B265-A3F8-480A-B63E-BE7DA3F9C981} = {3BF71760-5526-4089-8A43-ED8430847906} + {0294B2C3-07EF-45BD-843F-A3AD0FA8B8A0} = {15E62D85-34D1-44EE-9C43-AD3CC8D8558D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} diff --git a/src/client/Sinet.Universal.Admin.Blazor/Sinet.Universal.Admin.Blazor.csproj b/src/client/Sinet.Universal.Admin.Blazor/Sinet.Universal.Admin.Blazor.csproj index 822557d..8fe015c 100644 --- a/src/client/Sinet.Universal.Admin.Blazor/Sinet.Universal.Admin.Blazor.csproj +++ b/src/client/Sinet.Universal.Admin.Blazor/Sinet.Universal.Admin.Blazor.csproj @@ -20,13 +20,13 @@ - + - - - + + + diff --git a/src/client/Sinet.Universal.Admin.Client/App.xaml b/src/client/Sinet.Universal.Admin.Client/App.xaml new file mode 100644 index 0000000..8557938 --- /dev/null +++ b/src/client/Sinet.Universal.Admin.Client/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/src/client/Sinet.Universal.Admin.Client/App.xaml.cs b/src/client/Sinet.Universal.Admin.Client/App.xaml.cs new file mode 100644 index 0000000..dd3060e --- /dev/null +++ b/src/client/Sinet.Universal.Admin.Client/App.xaml.cs @@ -0,0 +1,63 @@ +using Microsoft.Extensions.DependencyInjection; +using Serilog; +using Serilog.Events; +using System.Configuration; +using System.Data; +using System.Windows; +using Volo.Abp; + +namespace Sinet.Universal.Admin.Client +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + private IAbpApplicationWithInternalServiceProvider? _abpApplication; + + protected override async void OnStartup(StartupEventArgs e) + { + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .Enrich.FromLogContext() + .WriteTo.Async(c => c.File("Logs/logs.txt")) + .CreateLogger(); + + try + { + Log.Information("Starting WPF host."); + + _abpApplication = await AbpApplicationFactory.CreateAsync(options => + { + options.UseAutofac(); + options.Services.AddLogging(loggingBuilder => loggingBuilder.AddSerilog(dispose: true)); + }); + + await _abpApplication.InitializeAsync(); + var serviceProvider = _abpApplication.Services.GetRequiredService(); + Resources.Add("services", serviceProvider); + _abpApplication.Services.GetRequiredService()?.Show(); + + } + catch (Exception ex) + { + Log.Fatal(ex, "Host terminated unexpectedly!"); + } + } + + protected override async void OnExit(ExitEventArgs e) + { + if (_abpApplication != null) + { + await _abpApplication.ShutdownAsync(); + } + Log.CloseAndFlush(); + } + } + +} diff --git a/src/client/Sinet.Universal.Admin.Client/AssemblyInfo.cs b/src/client/Sinet.Universal.Admin.Client/AssemblyInfo.cs new file mode 100644 index 0000000..b0ec827 --- /dev/null +++ b/src/client/Sinet.Universal.Admin.Client/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/src/client/Sinet.Universal.Admin.Client/ClientModule.cs b/src/client/Sinet.Universal.Admin.Client/ClientModule.cs new file mode 100644 index 0000000..ad554eb --- /dev/null +++ b/src/client/Sinet.Universal.Admin.Client/ClientModule.cs @@ -0,0 +1,51 @@ +using Masa.Blazor.Presets; +using Masa.Blazor; +using Microsoft.Extensions.DependencyInjection; +using Sinet.Universal.Admin.Client.Services; +using Sinet.Universal.Admin.RCL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Autofac; +using Volo.Abp.Modularity; + +namespace Sinet.Universal.Admin.Client +{ + + [DependsOn( + typeof(AdminHttpApiClientModule), + typeof(AdminBlazorServerModule), + typeof(AbpAutofacModule))] + public class ClientModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddSingleton(); + context.Services.AddMasaBlazor(options => + { + options.Defaults = new Dictionary?>() + { + { + PopupComponents.SNACKBAR, new Dictionary() + { + { nameof(PEnqueuedSnackbars.Closeable), true }, + { nameof(PEnqueuedSnackbars.Position), SnackPosition.TopCenter } + } + } + }; + }); + + context.Services.AddWpfBlazorWebView(); +#if DEBUG + context.Services.AddBlazorWebViewDeveloperTools(); +#endif + context.Services.AddScoped(); + } + } +} diff --git a/src/client/Sinet.Universal.Admin.Client/MainWindow.xaml b/src/client/Sinet.Universal.Admin.Client/MainWindow.xaml new file mode 100644 index 0000000..85a3d9d --- /dev/null +++ b/src/client/Sinet.Universal.Admin.Client/MainWindow.xaml @@ -0,0 +1,17 @@ + + + + + + + + + diff --git a/src/client/Sinet.Universal.Admin.Client/MainWindow.xaml.cs b/src/client/Sinet.Universal.Admin.Client/MainWindow.xaml.cs new file mode 100644 index 0000000..df843f1 --- /dev/null +++ b/src/client/Sinet.Universal.Admin.Client/MainWindow.xaml.cs @@ -0,0 +1,25 @@ +using Microsoft.Extensions.DependencyInjection; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Sinet.Universal.Admin.Client +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + } +} diff --git a/src/client/Sinet.Universal.Admin.Client/Services/ClientAppService.cs b/src/client/Sinet.Universal.Admin.Client/Services/ClientAppService.cs new file mode 100644 index 0000000..496e325 --- /dev/null +++ b/src/client/Sinet.Universal.Admin.Client/Services/ClientAppService.cs @@ -0,0 +1,17 @@ +using Sinet.Universal.Admin.RCL; +using Sinet.Universal.Admin.RCL.Services; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sinet.Universal.Admin.Client.Services +{ + public class ClientAppService : BaseAppService + { + public ClientAppService(CustomAuthenticationStateProvider authenticationStateProvider) : base(authenticationStateProvider) + { + } + } +} diff --git a/src/client/Sinet.Universal.Admin.Client/Sinet.Universal.Admin.Client.csproj b/src/client/Sinet.Universal.Admin.Client/Sinet.Universal.Admin.Client.csproj new file mode 100644 index 0000000..db4f052 --- /dev/null +++ b/src/client/Sinet.Universal.Admin.Client/Sinet.Universal.Admin.Client.csproj @@ -0,0 +1,32 @@ + + + WinExe + net7.0-windows + enable + enable + true + Sinet.Universal.Admin.Client + + + + + + + + + + + + + + + + + + + + Always + + + + diff --git a/src/client/Sinet.Universal.Admin.Client/appsettings.Development.json b/src/client/Sinet.Universal.Admin.Client/appsettings.Development.json new file mode 100644 index 0000000..0db3279 --- /dev/null +++ b/src/client/Sinet.Universal.Admin.Client/appsettings.Development.json @@ -0,0 +1,3 @@ +{ + +} diff --git a/src/client/Sinet.Universal.Admin.Client/appsettings.json b/src/client/Sinet.Universal.Admin.Client/appsettings.json new file mode 100644 index 0000000..205cdf7 --- /dev/null +++ b/src/client/Sinet.Universal.Admin.Client/appsettings.json @@ -0,0 +1,7 @@ +{ + "RemoteServices": { + "Default": { + "BaseUrl": "http://localhost:44333" + } + } +} diff --git a/src/client/Sinet.Universal.Admin.Client/wwwroot/favicon.ico b/src/client/Sinet.Universal.Admin.Client/wwwroot/favicon.ico new file mode 100644 index 0000000..63e859b Binary files /dev/null and b/src/client/Sinet.Universal.Admin.Client/wwwroot/favicon.ico differ diff --git a/src/client/Sinet.Universal.Admin.Client/wwwroot/index.html b/src/client/Sinet.Universal.Admin.Client/wwwroot/index.html new file mode 100644 index 0000000..3ce234e --- /dev/null +++ b/src/client/Sinet.Universal.Admin.Client/wwwroot/index.html @@ -0,0 +1,35 @@ + + + + + + Sinet.Universal.Admin.Client + + + + + + + + + + + + +
+ +
Loading...
+ +
+ An unhandled error has occurred. + Reload + 🗙 +
+ + + + + + + + \ No newline at end of file diff --git a/src/client/Sinet.Universal.Admin.Web/Sinet.Universal.Admin.Web.csproj b/src/client/Sinet.Universal.Admin.Web/Sinet.Universal.Admin.Web.csproj index 427a769..192dc63 100644 --- a/src/client/Sinet.Universal.Admin.Web/Sinet.Universal.Admin.Web.csproj +++ b/src/client/Sinet.Universal.Admin.Web/Sinet.Universal.Admin.Web.csproj @@ -9,10 +9,10 @@ - - - - + + + + @@ -31,4 +31,8 @@ + + + + diff --git a/src/common/Sinet.Universal.Admin.Application.Contracts/Sinet.Universal.Admin.Application.Contracts.csproj b/src/common/Sinet.Universal.Admin.Application.Contracts/Sinet.Universal.Admin.Application.Contracts.csproj index f9714aa..6edeba5 100644 --- a/src/common/Sinet.Universal.Admin.Application.Contracts/Sinet.Universal.Admin.Application.Contracts.csproj +++ b/src/common/Sinet.Universal.Admin.Application.Contracts/Sinet.Universal.Admin.Application.Contracts.csproj @@ -13,13 +13,13 @@
- - - - - - - + + + + + + + diff --git a/src/common/Sinet.Universal.Admin.Domain.Shared/Sinet.Universal.Admin.Domain.Shared.csproj b/src/common/Sinet.Universal.Admin.Domain.Shared/Sinet.Universal.Admin.Domain.Shared.csproj index d30048a..0cc6276 100644 --- a/src/common/Sinet.Universal.Admin.Domain.Shared/Sinet.Universal.Admin.Domain.Shared.csproj +++ b/src/common/Sinet.Universal.Admin.Domain.Shared/Sinet.Universal.Admin.Domain.Shared.csproj @@ -10,14 +10,14 @@ - - - - - - - - + + + + + + + + diff --git a/src/common/Sinet.Universal.Admin.HttpApi.Client/Sinet.Universal.Admin.HttpApi.Client.csproj b/src/common/Sinet.Universal.Admin.HttpApi.Client/Sinet.Universal.Admin.HttpApi.Client.csproj index 2541ddf..b3745f5 100644 --- a/src/common/Sinet.Universal.Admin.HttpApi.Client/Sinet.Universal.Admin.HttpApi.Client.csproj +++ b/src/common/Sinet.Universal.Admin.HttpApi.Client/Sinet.Universal.Admin.HttpApi.Client.csproj @@ -13,12 +13,12 @@ - - - - - - + + + + + + diff --git a/src/common/Sinet.Universal.Admin.HttpApi/Sinet.Universal.Admin.HttpApi.csproj b/src/common/Sinet.Universal.Admin.HttpApi/Sinet.Universal.Admin.HttpApi.csproj index adf1876..12a3230 100644 --- a/src/common/Sinet.Universal.Admin.HttpApi/Sinet.Universal.Admin.HttpApi.csproj +++ b/src/common/Sinet.Universal.Admin.HttpApi/Sinet.Universal.Admin.HttpApi.csproj @@ -13,12 +13,12 @@ - - - - - - + + + + + + diff --git a/src/common/Sinet.Universal.Admin.RCL/Pages/Authentication/Login-v1.razor.cs b/src/common/Sinet.Universal.Admin.RCL/Pages/Authentication/Login-v1.razor.cs index 17977ea..cb5c9ce 100644 --- a/src/common/Sinet.Universal.Admin.RCL/Pages/Authentication/Login-v1.razor.cs +++ b/src/common/Sinet.Universal.Admin.RCL/Pages/Authentication/Login-v1.razor.cs @@ -47,7 +47,7 @@ namespace Sinet.Universal.Admin.RCL.Pages.Authentication } catch (Exception ex) { - await PopupService.EnqueueSnackbarAsync($"登录失败: {ex.Message}", AlertTypes.Error); + await PopupService.EnqueueSnackbarAsync(ex); } } } diff --git a/src/common/Sinet.Universal.Admin.RCL/Sinet.Universal.Admin.RCL.csproj b/src/common/Sinet.Universal.Admin.RCL/Sinet.Universal.Admin.RCL.csproj index 2338944..0fdfa9d 100644 --- a/src/common/Sinet.Universal.Admin.RCL/Sinet.Universal.Admin.RCL.csproj +++ b/src/common/Sinet.Universal.Admin.RCL/Sinet.Universal.Admin.RCL.csproj @@ -13,11 +13,11 @@ - + - - + + diff --git a/src/server/Sinet.Universal.Admin.Application/Sinet.Universal.Admin.Application.csproj b/src/server/Sinet.Universal.Admin.Application/Sinet.Universal.Admin.Application.csproj index 732a5ba..65b31fc 100644 --- a/src/server/Sinet.Universal.Admin.Application/Sinet.Universal.Admin.Application.csproj +++ b/src/server/Sinet.Universal.Admin.Application/Sinet.Universal.Admin.Application.csproj @@ -14,13 +14,13 @@ - - - - - - - + + + + + + + diff --git a/src/server/Sinet.Universal.Admin.DbMigrator/Sinet.Universal.Admin.DbMigrator.csproj b/src/server/Sinet.Universal.Admin.DbMigrator/Sinet.Universal.Admin.DbMigrator.csproj index 75ba2c6..4d056ae 100644 --- a/src/server/Sinet.Universal.Admin.DbMigrator/Sinet.Universal.Admin.DbMigrator.csproj +++ b/src/server/Sinet.Universal.Admin.DbMigrator/Sinet.Universal.Admin.DbMigrator.csproj @@ -30,7 +30,7 @@ - + diff --git a/src/server/Sinet.Universal.Admin.Domain/Sinet.Universal.Admin.Domain.csproj b/src/server/Sinet.Universal.Admin.Domain/Sinet.Universal.Admin.Domain.csproj index c8c1085..ee4f638 100644 --- a/src/server/Sinet.Universal.Admin.Domain/Sinet.Universal.Admin.Domain.csproj +++ b/src/server/Sinet.Universal.Admin.Domain/Sinet.Universal.Admin.Domain.csproj @@ -13,16 +13,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/src/server/Sinet.Universal.Admin.EntityFrameworkCore/Sinet.Universal.Admin.EntityFrameworkCore.csproj b/src/server/Sinet.Universal.Admin.EntityFrameworkCore/Sinet.Universal.Admin.EntityFrameworkCore.csproj index 2cc7f47..fe9e7ce 100644 --- a/src/server/Sinet.Universal.Admin.EntityFrameworkCore/Sinet.Universal.Admin.EntityFrameworkCore.csproj +++ b/src/server/Sinet.Universal.Admin.EntityFrameworkCore/Sinet.Universal.Admin.EntityFrameworkCore.csproj @@ -10,15 +10,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/src/server/Sinet.Universal.Admin.HttpApi.Host/AdminHttpApiHostModule.cs b/src/server/Sinet.Universal.Admin.HttpApi.Host/AdminHttpApiHostModule.cs index 75b3815..c7ed70e 100644 --- a/src/server/Sinet.Universal.Admin.HttpApi.Host/AdminHttpApiHostModule.cs +++ b/src/server/Sinet.Universal.Admin.HttpApi.Host/AdminHttpApiHostModule.cs @@ -54,6 +54,7 @@ public class AdminHttpApiHostModule : AbpModule options.UseLocalServer(); options.UseAspNetCore(); }); + builder.AddServer(options => { options.UseAspNetCore().DisableTransportSecurityRequirement(); }); }); } diff --git a/src/server/Sinet.Universal.Admin.HttpApi.Host/Properties/launchSettings.json b/src/server/Sinet.Universal.Admin.HttpApi.Host/Properties/launchSettings.json index 63129d9..0942d81 100644 --- a/src/server/Sinet.Universal.Admin.HttpApi.Host/Properties/launchSettings.json +++ b/src/server/Sinet.Universal.Admin.HttpApi.Host/Properties/launchSettings.json @@ -3,7 +3,7 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "https://localhost:44333", + "applicationUrl": "http://localhost:44333", "sslPort": 44333 } }, @@ -18,7 +18,7 @@ "Sinet.Universal.Admin.HttpApi.Host": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "https://localhost:44333", + "applicationUrl": "http://localhost:44333", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/src/server/Sinet.Universal.Admin.HttpApi.Host/Sinet.Universal.Admin.HttpApi.Host.csproj b/src/server/Sinet.Universal.Admin.HttpApi.Host/Sinet.Universal.Admin.HttpApi.Host.csproj index 097e2a7..4be55a5 100644 --- a/src/server/Sinet.Universal.Admin.HttpApi.Host/Sinet.Universal.Admin.HttpApi.Host.csproj +++ b/src/server/Sinet.Universal.Admin.HttpApi.Host/Sinet.Universal.Admin.HttpApi.Host.csproj @@ -13,11 +13,11 @@ - - - - - + + + + + diff --git a/src/server/Sinet.Universal.Admin.Server.Host/Sinet.Universal.Admin.Server.Host.csproj b/src/server/Sinet.Universal.Admin.Server.Host/Sinet.Universal.Admin.Server.Host.csproj index b8d18db..ae5d88c 100644 --- a/src/server/Sinet.Universal.Admin.Server.Host/Sinet.Universal.Admin.Server.Host.csproj +++ b/src/server/Sinet.Universal.Admin.Server.Host/Sinet.Universal.Admin.Server.Host.csproj @@ -21,8 +21,8 @@ - - + + @@ -30,13 +30,13 @@ - - - - - - - + + + + + + + diff --git a/test/Sinet.Universal.Admin.EntityFrameworkCore.Tests/Sinet.Universal.Admin.EntityFrameworkCore.Tests.csproj b/test/Sinet.Universal.Admin.EntityFrameworkCore.Tests/Sinet.Universal.Admin.EntityFrameworkCore.Tests.csproj index f89cbe8..826de7c 100644 --- a/test/Sinet.Universal.Admin.EntityFrameworkCore.Tests/Sinet.Universal.Admin.EntityFrameworkCore.Tests.csproj +++ b/test/Sinet.Universal.Admin.EntityFrameworkCore.Tests/Sinet.Universal.Admin.EntityFrameworkCore.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/Sinet.Universal.Admin.HttpApi.Client.ConsoleTestApp/Sinet.Universal.Admin.HttpApi.Client.ConsoleTestApp.csproj b/test/Sinet.Universal.Admin.HttpApi.Client.ConsoleTestApp/Sinet.Universal.Admin.HttpApi.Client.ConsoleTestApp.csproj index 5bed3c4..dc3ba1e 100644 --- a/test/Sinet.Universal.Admin.HttpApi.Client.ConsoleTestApp/Sinet.Universal.Admin.HttpApi.Client.ConsoleTestApp.csproj +++ b/test/Sinet.Universal.Admin.HttpApi.Client.ConsoleTestApp/Sinet.Universal.Admin.HttpApi.Client.ConsoleTestApp.csproj @@ -20,8 +20,8 @@ - - + + diff --git a/test/Sinet.Universal.Admin.TestBase/Sinet.Universal.Admin.TestBase.csproj b/test/Sinet.Universal.Admin.TestBase/Sinet.Universal.Admin.TestBase.csproj index 3159e2c..fbb1bad 100644 --- a/test/Sinet.Universal.Admin.TestBase/Sinet.Universal.Admin.TestBase.csproj +++ b/test/Sinet.Universal.Admin.TestBase/Sinet.Universal.Admin.TestBase.csproj @@ -9,9 +9,9 @@ - - - + + +