Skip to content

Commit

Permalink
Merge pull request #107 from hx23840/1.0
Browse files Browse the repository at this point in the history
fix mysql url splicing error
  • Loading branch information
EchoXiaoLang authored Sep 17, 2022
2 parents 42ff94d + 9dc0f9b commit bfee339
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 bfee339

Please sign in to comment.