fix: 数据源校验返回信息

This commit is contained in:
taojinlong 2024-01-15 18:08:48 +08:00
parent fbe9f2821a
commit 539d407342
3 changed files with 8 additions and 3 deletions

View File

@ -136,6 +136,9 @@ public class DatasourceServer implements DatasourceApi {
dataSourceManage.move(dataSourceDTO);
}
case "rename" -> {
if(StringUtils.isEmpty(dataSourceDTO.getName())){
DEException.throwException("名称不能为空!");
}
CoreDatasource datasource = datasourceMapper.selectById(dataSourceDTO.getId());
datasource.setName(dataSourceDTO.getName());
dataSourceManage.innerEdit(datasource);
@ -464,8 +467,9 @@ public class DatasourceServer implements DatasourceApi {
CoreDatasource coreDatasource = new CoreDatasource();
BeanUtils.copyBean(coreDatasource, dataSourceDTO);
checkDatasourceStatus(coreDatasource);
dataSourceDTO.setStatus(coreDatasource.getStatus());
return dataSourceDTO;
DatasourceDTO result = new DatasourceDTO();
result.setStatus(coreDatasource.getStatus());
return result;
}
@Override

View File

@ -272,6 +272,7 @@ const saveDataset = () => {
showClose: false,
tip: ''
}
request.apiConfiguration = ''
checkRepeat(request).then(res => {
if (res) {
ElMessageBox.confirm(t('datasource.has_same_ds'), options as ElMessageBoxOptions).then(

View File

@ -391,6 +391,7 @@ const saveDS = () => {
request.configuration = Base64.encode(JSON.stringify(request.configuration))
}
const validate = detail.value.submitForm()
request.apiConfiguration = ''
validate(val => {
if (val) {
if (editDs.value && form.id) {
@ -401,7 +402,6 @@ const saveDS = () => {
showClose: false,
tip: ''
}
checkRepeat(request).then(res => {
if (res) {
ElMessageBox.confirm(t('datasource.has_same_ds'), options as ElMessageBoxOptions).then(