提交 9c21fea0 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

fix: 主题名称重复提示国际化

上级 d8f211b3
...@@ -2,6 +2,7 @@ package io.dataease.plugins.server; ...@@ -2,6 +2,7 @@ package io.dataease.plugins.server;
import java.util.List; import java.util.List;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -11,6 +12,7 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -11,6 +12,7 @@ import org.springframework.web.multipart.MultipartFile;
import io.dataease.commons.exception.DEException; import io.dataease.commons.exception.DEException;
import io.dataease.commons.utils.LogUtil; import io.dataease.commons.utils.LogUtil;
import io.dataease.i18n.Translator;
import io.dataease.plugins.config.SpringContextUtil; import io.dataease.plugins.config.SpringContextUtil;
import io.dataease.plugins.xpack.theme.dto.ThemeDto; import io.dataease.plugins.xpack.theme.dto.ThemeDto;
import io.dataease.plugins.xpack.theme.dto.ThemeItem; import io.dataease.plugins.xpack.theme.dto.ThemeItem;
...@@ -42,7 +44,13 @@ public class ThemeServer { ...@@ -42,7 +44,13 @@ public class ThemeServer {
themeXpackService.save(request, bodyFile); themeXpackService.save(request, bodyFile);
} catch (Exception e) { } catch (Exception e) {
LogUtil.error(e.getMessage(), e); LogUtil.error(e.getMessage(), e);
DEException.throwException(e); if (ObjectUtils.isNotEmpty(e.getMessage()) && e.getMessage().indexOf("theme_name_repeat") != -1) {
DEException.throwException(Translator.get("theme_name_repeat"));
} else if (ObjectUtils.isNotEmpty(e.getMessage()) && e.getMessage().indexOf("theme_name_empty") != -1) {
DEException.throwException(Translator.get("theme_name_empty"));
} else {
DEException.throwException(e);
}
} }
} }
......
...@@ -116,4 +116,6 @@ i18n_rp_exist=Row permission of the same type already exists ...@@ -116,4 +116,6 @@ i18n_rp_exist=Row permission of the same type already exists
i18n_field_name_repeat=Field name can't repeat i18n_field_name_repeat=Field name can't repeat
i18n_calc_field_error=Field expression error i18n_calc_field_error=Field expression error
i18n_cp_exist=Column permission of the same type already exists i18n_cp_exist=Column permission of the same type already exists
connection_failed=Connection Failed connection_failed=Connection Failed
\ No newline at end of file theme_name_repeat=name of theme has been existed
theme_name_empty=name can not be empty
\ No newline at end of file
...@@ -116,3 +116,5 @@ i18n_field_name_repeat=字段名不能重复 ...@@ -116,3 +116,5 @@ i18n_field_name_repeat=字段名不能重复
i18n_calc_field_error=字段表达式语法错误 i18n_calc_field_error=字段表达式语法错误
i18n_cp_exist=已有同类型的列权限存在 i18n_cp_exist=已有同类型的列权限存在
connection_failed=连接失败 connection_failed=连接失败
theme_name_repeat=名称已存在
theme_name_empty=名称不能为空
...@@ -117,3 +117,5 @@ i18n_field_name_repeat=字段名不能重復 ...@@ -117,3 +117,5 @@ i18n_field_name_repeat=字段名不能重復
i18n_calc_field_error=字段表達式語法錯誤 i18n_calc_field_error=字段表達式語法錯誤
i18n_cp_exist=已有同類型的列權限存在 i18n_cp_exist=已有同類型的列權限存在
connection_failed=連接失敗 connection_failed=連接失敗
theme_name_repeat=名稱已存在
theme_name_empty=名稱不能為空
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论