From 875ebac95c053aa4f3241bbe76e72219382c554a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Wed, 14 Sep 2022 21:49:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Controllers/CommonController.cs | 2 +- .../Controllers/System/CodeGeneratorController.cs | 8 +++++--- ZR.Admin.WebApi/Extensions/SwaggerExtension.cs | 3 +-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/CommonController.cs b/ZR.Admin.WebApi/Controllers/CommonController.cs index 8854422..21c1cf2 100644 --- a/ZR.Admin.WebApi/Controllers/CommonController.cs +++ b/ZR.Admin.WebApi/Controllers/CommonController.cs @@ -48,7 +48,7 @@ namespace ZR.Admin.WebApi.Controllers public IActionResult Index() { return Ok("看到这里页面说明你已经成功启动了本项目:)\n\n" + - "如果觉得项目有用,打赏作者喝杯咖啡作为奖励\n☛☛http://www.izhaorui.cn/doc\n"); + "如果觉得项目有用,打赏作者喝杯咖啡作为奖励\n☛☛http://www.izhaorui.cn/doc/support.html\n"); } /// diff --git a/ZR.Admin.WebApi/Controllers/System/CodeGeneratorController.cs b/ZR.Admin.WebApi/Controllers/System/CodeGeneratorController.cs index b356982..db9ff1f 100644 --- a/ZR.Admin.WebApi/Controllers/System/CodeGeneratorController.cs +++ b/ZR.Admin.WebApi/Controllers/System/CodeGeneratorController.cs @@ -227,9 +227,11 @@ namespace ZR.Admin.WebApi.Controllers [ActionPermissionFilter(Permission = "tool:gen:preview")] public IActionResult Preview(long tableId = 0, int VueVersion = 0) { - GenerateDto dto = new(); - dto.TableId = tableId; - dto.VueVersion = VueVersion; + GenerateDto dto = new() + { + TableId = tableId, + VueVersion = VueVersion + }; if (dto == null || dto.TableId <= 0) { throw new CustomException(ResultCode.CUSTOM_ERROR, "请求参数为空"); diff --git a/ZR.Admin.WebApi/Extensions/SwaggerExtension.cs b/ZR.Admin.WebApi/Extensions/SwaggerExtension.cs index 6df2ab2..9851d0d 100644 --- a/ZR.Admin.WebApi/Extensions/SwaggerExtension.cs +++ b/ZR.Admin.WebApi/Extensions/SwaggerExtension.cs @@ -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 {