Skip to content

Commit

Permalink
fix: mysql url splicing error
Browse files Browse the repository at this point in the history
  • Loading branch information
peter committed Sep 17, 2022
1 parent 6183bd0 commit 8588ff7
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ public Result<Boolean, Object> 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) {
Expand Down Expand Up @@ -162,7 +166,11 @@ public Result<Boolean, Object> 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) {
Expand Down

0 comments on commit 8588ff7

Please sign in to comment.