diff --git a/WorkStation.Client/App.xaml b/WorkStation.Client/App.xaml
new file mode 100644
index 0000000..18a3c3c
--- /dev/null
+++ b/WorkStation.Client/App.xaml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WorkStation.Client/App.xaml.cs b/WorkStation.Client/App.xaml.cs
new file mode 100644
index 0000000..1df9d57
--- /dev/null
+++ b/WorkStation.Client/App.xaml.cs
@@ -0,0 +1,37 @@
+using Prism.Ioc;
+using Prism.Services.Dialogs;
+using System.Windows;
+using WorkStation.Client.ViewModels.Dialogs;
+using WorkStation.Client.Views;
+using WorkStation.Client.Views.Dialogs;
+
+namespace WorkStation.Client
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App
+ {
+ protected override Window CreateShell()
+ {
+ return Container.Resolve();
+ }
+ protected override void OnInitialized()
+ {
+ var dialogService = Container.Resolve();
+ dialogService.ShowDialog("LoginView", result =>
+ {
+ if (result.Result == ButtonResult.OK)
+ {
+ base.OnInitialized();
+ }
+ });
+
+
+ }
+ protected override void RegisterTypes(IContainerRegistry containerRegistry)
+ {
+ containerRegistry.RegisterDialog();
+ }
+ }
+}
diff --git a/WorkStation.Client/Images/LoginImage.png b/WorkStation.Client/Images/LoginImage.png
new file mode 100644
index 0000000..f586e0a
Binary files /dev/null and b/WorkStation.Client/Images/LoginImage.png differ
diff --git a/WorkStation.Client/ViewModels/Dialogs/LoginViewModel.cs b/WorkStation.Client/ViewModels/Dialogs/LoginViewModel.cs
new file mode 100644
index 0000000..2c4a25c
--- /dev/null
+++ b/WorkStation.Client/ViewModels/Dialogs/LoginViewModel.cs
@@ -0,0 +1,90 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace WorkStation.Client.ViewModels.Dialogs
+{
+ public class LoginViewModel : BindableBase, IDialogAware
+ {
+ ///
+ /// 弹窗标题
+ ///
+ public string Title => "登录界面";
+
+ ///
+ /// 账户
+ ///
+ private string _account = string.Empty;
+ public string Account
+ {
+ get => _account;
+ set => SetProperty(ref _account, value);
+ }
+
+ ///
+ /// 密码
+ ///
+ private string _password = string.Empty;
+ public string Password
+ {
+ get => _password;
+ set => SetProperty(ref _password, value);
+ }
+
+ ///
+ /// 用于关闭窗口时,判断是否登录成功。
+ /// 如果登录失败就终止当前应用。
+ ///
+ private bool _isSuccess = false;
+
+ ///
+ /// 登录名利
+ ///
+ public DelegateCommand LoginCommand { get; set; }
+
+ ///
+ /// 请求关闭委托
+ ///
+ public event Action RequestClose;
+
+ ///
+ /// Determines whether the dialog can be closed.
+ ///
+ /// if the dialog can be closed; otherwise, .
+ public bool CanCloseDialog()
+ {
+ return true;
+ }
+
+ public void OnDialogClosed()
+ {
+ if (_isSuccess == false)
+ {
+ Application.Current.Shutdown();
+ }
+ }
+
+ public void OnDialogOpened(IDialogParameters parameters)
+ {
+
+ }
+ public LoginViewModel()
+ {
+ LoginCommand = new DelegateCommand(() =>
+ {
+ if (Account == "11" && Password == "22")
+ {
+ _isSuccess = true;
+ RequestClose(new DialogResult(ButtonResult.OK));
+ }
+ });
+ }
+ }
+}
diff --git a/WorkStationClient/ViewModels/MainWindowViewModel.cs b/WorkStation.Client/ViewModels/MainWindowViewModel.cs
similarity index 89%
rename from WorkStationClient/ViewModels/MainWindowViewModel.cs
rename to WorkStation.Client/ViewModels/MainWindowViewModel.cs
index 0df0abe..7f5c705 100644
--- a/WorkStationClient/ViewModels/MainWindowViewModel.cs
+++ b/WorkStation.Client/ViewModels/MainWindowViewModel.cs
@@ -1,6 +1,6 @@
using Prism.Mvvm;
-namespace WorkStationClient.ViewModels
+namespace WorkStation.Client.ViewModels
{
public class MainWindowViewModel : BindableBase
{
diff --git a/WorkStation.Client/Views/Dialogs/LoginView.xaml b/WorkStation.Client/Views/Dialogs/LoginView.xaml
new file mode 100644
index 0000000..e698cae
--- /dev/null
+++ b/WorkStation.Client/Views/Dialogs/LoginView.xaml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WorkStation.Client/Views/Dialogs/LoginView.xaml.cs b/WorkStation.Client/Views/Dialogs/LoginView.xaml.cs
new file mode 100644
index 0000000..9ff46a5
--- /dev/null
+++ b/WorkStation.Client/Views/Dialogs/LoginView.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+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 WorkStation.Client.Views.Dialogs
+{
+ ///
+ /// Interaction logic for LoginView.xaml
+ ///
+ public partial class LoginView : UserControl
+ {
+ public LoginView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/WorkStation.Client/Views/MainWindow.xaml b/WorkStation.Client/Views/MainWindow.xaml
new file mode 100644
index 0000000..2c64210
--- /dev/null
+++ b/WorkStation.Client/Views/MainWindow.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/WorkStationClient/Views/MainWindow.xaml.cs b/WorkStation.Client/Views/MainWindow.xaml.cs
similarity index 87%
rename from WorkStationClient/Views/MainWindow.xaml.cs
rename to WorkStation.Client/Views/MainWindow.xaml.cs
index 8437e31..78e964c 100644
--- a/WorkStationClient/Views/MainWindow.xaml.cs
+++ b/WorkStation.Client/Views/MainWindow.xaml.cs
@@ -1,6 +1,6 @@
using System.Windows;
-namespace WorkStationClient.Views
+namespace WorkStation.Client.Views
{
///
/// Interaction logic for MainWindow.xaml
diff --git a/WorkStationClient/WorkStationClient.csproj b/WorkStation.Client/WorkStation.Client.csproj
similarity index 56%
rename from WorkStationClient/WorkStationClient.csproj
rename to WorkStation.Client/WorkStation.Client.csproj
index e44cc0c..03a5c32 100644
--- a/WorkStationClient/WorkStationClient.csproj
+++ b/WorkStation.Client/WorkStation.Client.csproj
@@ -5,6 +5,13 @@
true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WorkStation.Server/Controllers/WeatherForecastController.cs b/WorkStation.Server/Controllers/WeatherForecastController.cs
new file mode 100644
index 0000000..73e46d6
--- /dev/null
+++ b/WorkStation.Server/Controllers/WeatherForecastController.cs
@@ -0,0 +1,33 @@
+using Microsoft.AspNetCore.Mvc;
+
+namespace WorkStation.Server.Controllers
+{
+ [ApiController]
+ [Route("[controller]")]
+ public class WeatherForecastController : ControllerBase
+ {
+ private static readonly string[] Summaries = new[]
+ {
+ "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
+ };
+
+ private readonly ILogger _logger;
+
+ public WeatherForecastController(ILogger logger)
+ {
+ _logger = logger;
+ }
+
+ [HttpGet(Name = "GetWeatherForecast")]
+ public IEnumerable Get()
+ {
+ return Enumerable.Range(1, 5).Select(index => new WeatherForecast
+ {
+ Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
+ TemperatureC = Random.Shared.Next(-20, 55),
+ Summary = Summaries[Random.Shared.Next(Summaries.Length)]
+ })
+ .ToArray();
+ }
+ }
+}
diff --git a/WorkStation.Server/Program.cs b/WorkStation.Server/Program.cs
new file mode 100644
index 0000000..48863a6
--- /dev/null
+++ b/WorkStation.Server/Program.cs
@@ -0,0 +1,25 @@
+var builder = WebApplication.CreateBuilder(args);
+
+// Add services to the container.
+
+builder.Services.AddControllers();
+// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
+builder.Services.AddEndpointsApiExplorer();
+builder.Services.AddSwaggerGen();
+
+var app = builder.Build();
+
+// Configure the HTTP request pipeline.
+if (app.Environment.IsDevelopment())
+{
+ app.UseSwagger();
+ app.UseSwaggerUI();
+}
+
+app.UseHttpsRedirection();
+
+app.UseAuthorization();
+
+app.MapControllers();
+
+app.Run();
diff --git a/WorkStation.Server/Properties/launchSettings.json b/WorkStation.Server/Properties/launchSettings.json
new file mode 100644
index 0000000..d50623b
--- /dev/null
+++ b/WorkStation.Server/Properties/launchSettings.json
@@ -0,0 +1,41 @@
+{
+ "$schema": "http://json.schemastore.org/launchsettings.json",
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:54136",
+ "sslPort": 44341
+ }
+ },
+ "profiles": {
+ "http": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "launchUrl": "swagger",
+ "applicationUrl": "http://localhost:5153",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "launchUrl": "swagger",
+ "applicationUrl": "https://localhost:7029;http://localhost:5153",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "launchUrl": "swagger",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/WorkStation.Server/WeatherForecast.cs b/WorkStation.Server/WeatherForecast.cs
new file mode 100644
index 0000000..55d094d
--- /dev/null
+++ b/WorkStation.Server/WeatherForecast.cs
@@ -0,0 +1,13 @@
+namespace WorkStation.Server
+{
+ public class WeatherForecast
+ {
+ public DateOnly Date { get; set; }
+
+ public int TemperatureC { get; set; }
+
+ public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
+
+ public string? Summary { get; set; }
+ }
+}
diff --git a/WorkStation.Server/WorkStation.Server.csproj b/WorkStation.Server/WorkStation.Server.csproj
new file mode 100644
index 0000000..5419ef0
--- /dev/null
+++ b/WorkStation.Server/WorkStation.Server.csproj
@@ -0,0 +1,13 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
diff --git a/WorkStation.Server/WorkStation.Server.http b/WorkStation.Server/WorkStation.Server.http
new file mode 100644
index 0000000..ce82a76
--- /dev/null
+++ b/WorkStation.Server/WorkStation.Server.http
@@ -0,0 +1,6 @@
+@WorkStation.Server_HostAddress = http://localhost:5153
+
+GET {{WorkStation.Server_HostAddress}}/weatherforecast/
+Accept: application/json
+
+###
diff --git a/WorkStation.Server/appsettings.Development.json b/WorkStation.Server/appsettings.Development.json
new file mode 100644
index 0000000..0c208ae
--- /dev/null
+++ b/WorkStation.Server/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/WorkStation.Server/appsettings.json b/WorkStation.Server/appsettings.json
new file mode 100644
index 0000000..10f68b8
--- /dev/null
+++ b/WorkStation.Server/appsettings.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "AllowedHosts": "*"
+}
diff --git a/WorkStation.Share/Class1.cs b/WorkStation.Share/Class1.cs
new file mode 100644
index 0000000..310e2d1
--- /dev/null
+++ b/WorkStation.Share/Class1.cs
@@ -0,0 +1,7 @@
+namespace WorkStation.Share
+{
+ public class Class1
+ {
+
+ }
+}
diff --git a/WorkStation.Share/WorkStation.Share.csproj b/WorkStation.Share/WorkStation.Share.csproj
new file mode 100644
index 0000000..fa71b7a
--- /dev/null
+++ b/WorkStation.Share/WorkStation.Share.csproj
@@ -0,0 +1,9 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
diff --git a/WorkStation.sln b/WorkStation.sln
index 272e37d..fe1ce53 100644
--- a/WorkStation.sln
+++ b/WorkStation.sln
@@ -1,9 +1,13 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
-VisualStudioVersion = 17.14.36221.1 d17.14
+VisualStudioVersion = 17.14.36221.1
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkStationClient", "WorkStationClient\WorkStationClient.csproj", "{B3D9EF99-5FA3-4533-91FE-2A107E81C4A0}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkStation.Share", "WorkStation.Share\WorkStation.Share.csproj", "{427790B0-1AD5-4F27-B528-99767140BFBC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkStation.Client", "WorkStation.Client\WorkStation.Client.csproj", "{52C6BEFE-0576-4885-8E98-4A53C63282ED}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkStation.Server", "WorkStation.Server\WorkStation.Server.csproj", "{9486DBEA-0AFC-4611-8739-421BBD92DBC1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,10 +15,18 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {B3D9EF99-5FA3-4533-91FE-2A107E81C4A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B3D9EF99-5FA3-4533-91FE-2A107E81C4A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B3D9EF99-5FA3-4533-91FE-2A107E81C4A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B3D9EF99-5FA3-4533-91FE-2A107E81C4A0}.Release|Any CPU.Build.0 = Release|Any CPU
+ {427790B0-1AD5-4F27-B528-99767140BFBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {427790B0-1AD5-4F27-B528-99767140BFBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {427790B0-1AD5-4F27-B528-99767140BFBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {427790B0-1AD5-4F27-B528-99767140BFBC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {52C6BEFE-0576-4885-8E98-4A53C63282ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {52C6BEFE-0576-4885-8E98-4A53C63282ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {52C6BEFE-0576-4885-8E98-4A53C63282ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {52C6BEFE-0576-4885-8E98-4A53C63282ED}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9486DBEA-0AFC-4611-8739-421BBD92DBC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9486DBEA-0AFC-4611-8739-421BBD92DBC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9486DBEA-0AFC-4611-8739-421BBD92DBC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9486DBEA-0AFC-4611-8739-421BBD92DBC1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/WorkStationClient/App.xaml b/WorkStationClient/App.xaml
deleted file mode 100644
index acbe2fc..0000000
--- a/WorkStationClient/App.xaml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
diff --git a/WorkStationClient/App.xaml.cs b/WorkStationClient/App.xaml.cs
deleted file mode 100644
index 81c3495..0000000
--- a/WorkStationClient/App.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Windows;
-using Prism.Ioc;
-using WorkStationClient.Views;
-
-namespace WorkStationClient
-{
- ///
- /// Interaction logic for App.xaml
- ///
- public partial class App
- {
- protected override Window CreateShell()
- {
- return Container.Resolve();
- }
-
- protected override void RegisterTypes(IContainerRegistry containerRegistry)
- {
-
- }
- }
-}
diff --git a/WorkStationClient/Views/MainWindow.xaml b/WorkStationClient/Views/MainWindow.xaml
deleted file mode 100644
index b773011..0000000
--- a/WorkStationClient/Views/MainWindow.xaml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-