From 539a56279625242c497b4b4093f2defbb9d80334 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期四, 29 一月 2026 14:05:44 +0800
Subject: [PATCH] #i18n翻译
---
src/main/java/com/zy/common/config/CoolExceptionHandler.java | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/zy/common/config/CoolExceptionHandler.java b/src/main/java/com/zy/common/config/CoolExceptionHandler.java
index 5d7e928..5be4ef6 100644
--- a/src/main/java/com/zy/common/config/CoolExceptionHandler.java
+++ b/src/main/java/com/zy/common/config/CoolExceptionHandler.java
@@ -26,9 +26,18 @@
@ExceptionHandler(CoolException.class)
public R handleRRException(CoolException e) {
+ String msg = e.getMessage();
+ if (msg != null && msg.contains("|")) {
+ String[] split = msg.split("\\|", 2);
+ R r = R.error(split[0]);
+ r.put("data", split[1]);
+ return r;
+ }
String[] split = e.getMessage().split("-");
if (split.length == 2) {
- return R.parse(e.getMessage());
+ if (String.valueOf(split[0]).length() < 3) {
+ return R.parse(e.getMessage());
+ }
}
return R.error(e.getMessage());
}
--
Gitblit v1.9.1