fix(数据源): 「数据源」与「目录」名称不能为空

This commit is contained in:
taojinlong 2025-01-20 14:13:24 +08:00 committed by taojinlong
parent b5d3b11fac
commit e5ad3ebca0

View File

@ -94,6 +94,9 @@ public class DataSourceManage {
} }
public void checkName(DatasourceDTO dto) { public void checkName(DatasourceDTO dto) {
if(StringUtils.isEmpty(dto.getName()) || StringUtils.isEmpty(dto.getName().trim())){
DEException.throwException(Translator.get("i18n_df_name_can_not_empty"));
}
QueryWrapper<CoreDatasource> wrapper = new QueryWrapper<>(); QueryWrapper<CoreDatasource> wrapper = new QueryWrapper<>();
if (ObjectUtils.isNotEmpty(dto.getPid())) { if (ObjectUtils.isNotEmpty(dto.getPid())) {
if (LicenseUtil.licenseValid() && dto.getPid().equals(0L)) { if (LicenseUtil.licenseValid() && dto.getPid().equals(0L)) {