From 8588ff7d4a9c6d40eace60b8100b390ce6907833 Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 17 Sep 2022 18:36:33 +0800 Subject: [PATCH] fix: mysql url splicing error --- .../controller/DatasourceServiceApiController.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dataintegration-model/dataintegration-model-management-provider/src/main/java/com/youngdatafan/portal/model/management/datasource/controller/DatasourceServiceApiController.java b/dataintegration-model/dataintegration-model-management-provider/src/main/java/com/youngdatafan/portal/model/management/datasource/controller/DatasourceServiceApiController.java index 2bfc0b1..f381480 100644 --- a/dataintegration-model/dataintegration-model-management-provider/src/main/java/com/youngdatafan/portal/model/management/datasource/controller/DatasourceServiceApiController.java +++ b/dataintegration-model/dataintegration-model-management-provider/src/main/java/com/youngdatafan/portal/model/management/datasource/controller/DatasourceServiceApiController.java @@ -113,7 +113,11 @@ public Result jcAdd(String userId, JCDataSourceVO jcDataSourceV datasource.setDriverClassName(jcDataSourceVO.getCustomDriverClass()); } else { url = datasourceService.getUrl(jcDataSourceVO); - datasource.setDsUrl(url + "?access=" + jcDataSourceVO.getAccess()); + if (!url.contains("?")) { + datasource.setDsUrl(url + "?access=" + jcDataSourceVO.getAccess()); + } else { + datasource.setDsUrl(url + "&access=" + jcDataSourceVO.getAccess()); + } } if (jcDataSourceVO.getDsConnectorSetting() != null) { @@ -162,7 +166,11 @@ public Result jcUpdate(String userId, JCDataSourceVO jcDataSour datasource.setDriverClassName(jcDataSourceVO.getCustomDriverClass()); } else { url = datasourceService.getUrl(jcDataSourceVO); - datasource.setDsUrl(url + "?access=" + jcDataSourceVO.getAccess()); + if (!url.contains("?")) { + datasource.setDsUrl(url + "?access=" + jcDataSourceVO.getAccess()); + }else{ + datasource.setDsUrl(url + "&access=" + jcDataSourceVO.getAccess()); + } } if (jcDataSourceVO.getDsConnectorSetting() != null) {