forked from github/dataease
fix: 主题名称重复提示国际化
This commit is contained in:
parent
9b98736627
commit
60b8842c5e
@ -2,6 +2,7 @@ package io.dataease.plugins.server;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -11,6 +12,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import io.dataease.commons.exception.DEException;
|
||||
import io.dataease.commons.utils.LogUtil;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.plugins.config.SpringContextUtil;
|
||||
import io.dataease.plugins.xpack.theme.dto.ThemeDto;
|
||||
import io.dataease.plugins.xpack.theme.dto.ThemeItem;
|
||||
@ -42,7 +44,13 @@ public class ThemeServer {
|
||||
themeXpackService.save(request, bodyFile);
|
||||
} catch (Exception 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -117,3 +117,5 @@ i18n_field_name_repeat=Field name can't repeat
|
||||
i18n_calc_field_error=Field expression error
|
||||
i18n_cp_exist=Column permission of the same type already exists
|
||||
connection_failed=Connection Failed
|
||||
theme_name_repeat=name of theme has been existed
|
||||
theme_name_empty=name can not be empty
|
@ -116,3 +116,5 @@ i18n_field_name_repeat=字段名不能重复
|
||||
i18n_calc_field_error=字段表达式语法错误
|
||||
i18n_cp_exist=已有同类型的列权限存在
|
||||
connection_failed=连接失败
|
||||
theme_name_repeat=名称已存在
|
||||
theme_name_empty=名称不能为空
|
||||
|
@ -117,3 +117,5 @@ i18n_field_name_repeat=字段名不能重復
|
||||
i18n_calc_field_error=字段表達式語法錯誤
|
||||
i18n_cp_exist=已有同類型的列權限存在
|
||||
connection_failed=連接失敗
|
||||
theme_name_repeat=名稱已存在
|
||||
theme_name_empty=名稱不能為空
|
||||
|
Loading…
Reference in New Issue
Block a user