From 6cf78d77ef6baeb005df9819daadf180487c4cc2 Mon Sep 17 00:00:00 2001 From: smartwyy <645583145@qq.com> Date: Mon, 20 May 2024 17:36:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Car/Server/CarServerMgr.cs | 4 ++-- WebStarter/Program.cs | 3 ++- WebStarter/appsettings.json | 7 +++++-- WebStarter/bin/Debug/net6.0/appsettings.json | 7 +++++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Service/Car/Server/CarServerMgr.cs b/Service/Car/Server/CarServerMgr.cs index ce76254..8cdb170 100644 --- a/Service/Car/Server/CarServerMgr.cs +++ b/Service/Car/Server/CarServerMgr.cs @@ -7,9 +7,9 @@ public class CarServerMgr { public static CarServer? CarServer { get; set; } - public static void InitServer() + public static void InitServer(int port) { CarServer = AppInfo.Container.Resolve(); - CarServer.Start(5588); + CarServer.Start(port); } } \ No newline at end of file diff --git a/WebStarter/Program.cs b/WebStarter/Program.cs index 2cecbe5..ecd0646 100644 --- a/WebStarter/Program.cs +++ b/WebStarter/Program.cs @@ -93,5 +93,6 @@ app.MapControllers(); AppInfo.Container = app.Services.GetAutofacRoot(); -CarServerMgr.InitServer(); +var listen = builder.Configuration.GetSection("Listen"); +CarServerMgr.InitServer(int.Parse(listen.GetSection("Port").Value ?? "5588")); app.Run(); \ No newline at end of file diff --git a/WebStarter/appsettings.json b/WebStarter/appsettings.json index d39130a..520ea7e 100644 --- a/WebStarter/appsettings.json +++ b/WebStarter/appsettings.json @@ -7,10 +7,10 @@ "Update": { "AutoUpdate": "false", "Version": "1.1.0.1", - "Url": "http://121.4.95.243:8090/Updates/AutoUpdaterStarter.xml" + "Url": "http://1:8090/Updates/AutoUpdaterStarter.xml" }, "Redis": { - "Connection": "106.12.36.89:6379,password=123456", + "Connection": "1:6379,password=123456", "InstanceName": "local", "DefaultDB": "8" }, @@ -20,5 +20,8 @@ "Microsoft.AspNetCore": "Warning" } }, + "Listen": { + "Port": 5588 + }, "AllowedHosts": "*" } diff --git a/WebStarter/bin/Debug/net6.0/appsettings.json b/WebStarter/bin/Debug/net6.0/appsettings.json index d39130a..520ea7e 100644 --- a/WebStarter/bin/Debug/net6.0/appsettings.json +++ b/WebStarter/bin/Debug/net6.0/appsettings.json @@ -7,10 +7,10 @@ "Update": { "AutoUpdate": "false", "Version": "1.1.0.1", - "Url": "http://121.4.95.243:8090/Updates/AutoUpdaterStarter.xml" + "Url": "http://1:8090/Updates/AutoUpdaterStarter.xml" }, "Redis": { - "Connection": "106.12.36.89:6379,password=123456", + "Connection": "1:6379,password=123456", "InstanceName": "local", "DefaultDB": "8" }, @@ -20,5 +20,8 @@ "Microsoft.AspNetCore": "Warning" } }, + "Listen": { + "Port": 5588 + }, "AllowedHosts": "*" }