优化代码

This commit is contained in:
不做码农
2022-09-14 21:49:04 +08:00
parent c372c9a9e2
commit 875ebac95c
3 changed files with 7 additions and 6 deletions

View File

@@ -21,8 +21,7 @@ namespace ZR.Admin.WebApi.Extensions
var url = $"{httpReq.Scheme}://{httpReq.Host.Value}";
var referer = httpReq.Headers["Referer"].ToString();
if (referer.Contains(GlobalConstant.DevApiProxy))
url = referer.Substring(0,
referer.IndexOf(GlobalConstant.DevApiProxy, StringComparison.InvariantCulture) + GlobalConstant.DevApiProxy.Length - 1);
url = referer[..(referer.IndexOf(GlobalConstant.DevApiProxy, StringComparison.InvariantCulture) + GlobalConstant.DevApiProxy.Length - 1)];
swaggerDoc.Servers =
new List<OpenApiServer>
{