From f469ce0227bbdcb5b79e41ddc99f302af3883166 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 6 Dec 2023 10:17:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E4=B9=8B=E5=89=8D=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E7=9A=84=E6=96=B9=E5=BC=8F=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Progranm.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.API/Progranm.cs b/IRaCIS.Core.API/Progranm.cs index af047ad5f..c58aaf662 100644 --- a/IRaCIS.Core.API/Progranm.cs +++ b/IRaCIS.Core.API/Progranm.cs @@ -24,6 +24,7 @@ using IRaCIS.Core.Application.Filter; using Microsoft.AspNetCore.HttpOverrides; using IRaCIS.Application.Services.BackGroundJob; using LogDashboard; +using OfficeOpenXml.Utils; @@ -52,12 +53,20 @@ var builder = WebApplication.CreateBuilder(new WebApplicationOptions #region 兼容windows 服务命令行的方式 -var urlsIndex = Array.IndexOf(args, "--urls"); +//foreach (var arg in args) +//{ +// Console.WriteLine(arg); +//} + +int urlsIndex = Array.FindIndex(args, arg => arg != null && arg.StartsWith("--urls")); + if (urlsIndex > -1) { - builder.WebHost.UseUrls(args[urlsIndex + 1]); + var url = args[urlsIndex].Substring("--urls=".Length); + Console.WriteLine(url); + builder.WebHost.UseUrls(url); } -// + #endregion #region 主机配置