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