From 2e04b72dbaa25440fef090895ed70c02d8d53bd3 Mon Sep 17 00:00:00 2001 From: Elivo Date: Mon, 7 Jul 2025 13:59:20 +0800 Subject: [PATCH] =?UTF-8?q?ApiProcessor=EF=BC=9ADefaultRenderer=20API=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E8=BF=94=E5=9B=9E=E7=B1=BB=E5=9E=8B=E6=98=AF?= =?UTF-8?q?=20void=20=E6=97=B6=E4=B8=8D=E5=86=8D=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=90=8E=E7=BB=AD=E6=B5=81=E7=A8=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Apewer/Web/ApiProcessor.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Apewer/Web/ApiProcessor.cs b/Apewer/Web/ApiProcessor.cs index 309cfc6..b94e7f5 100644 --- a/Apewer/Web/ApiProcessor.cs +++ b/Apewer/Web/ApiProcessor.cs @@ -158,6 +158,8 @@ namespace Apewer.Web #region common + static Type Void = typeof(void); + // 创建控制器实例 static ApiController CreateController(Type type, ApiRequest request, ApiResponse response, ApiOptions options) { @@ -184,7 +186,7 @@ namespace Apewer.Web // 没有返回类型。 var returnType = method.ReturnType; - if (returnType == null) return; + if (returnType == null || returnType.Equals(Void)) return; // 已明确字符串类型。 if (returnType.Equals(typeof(string)))