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": "*" }