From 4ea51d089f7d6b787dc57a02c29ff47c995643fa Mon Sep 17 00:00:00 2001 From: Tang Date: Fri, 19 Jan 2024 16:49:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=93=8D=E5=BA=94=E7=9A=84=E6=88=90=E5=8A=9F=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/com/tang/framework/aop/ControllerAspect.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tang-framework/src/main/kotlin/com/tang/framework/aop/ControllerAspect.kt b/tang-framework/src/main/kotlin/com/tang/framework/aop/ControllerAspect.kt index b1c4b9a1..bd673a6d 100644 --- a/tang-framework/src/main/kotlin/com/tang/framework/aop/ControllerAspect.kt +++ b/tang-framework/src/main/kotlin/com/tang/framework/aop/ControllerAspect.kt @@ -42,13 +42,11 @@ class ControllerAspect { var response: Any? = null message = try { response = proceedingJoinPoint.proceed() - if (response is AjaxResult) { - response["msg"] + when (response) { + is AjaxResult -> response["msg"].toString() + is TableDataResult -> response.msg.toString() + else -> "成功" } - if (response is TableDataResult) { - response.msg - } - "成功" } catch (e: Exception) { LogUtils.error("请求失败", e) throwable = e