Merge pull request #9580 from dataease/pr@dev-v2@fix_outer-datasource

fix(仪表板): 修复默认数据源不兼容外部指定数据源问题
This commit is contained in:
王嘉豪 2024-05-10 11:32:26 +08:00 committed by GitHub
commit 4c73bdcd93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -158,6 +158,7 @@ public class EngineManage {
public void initLocalDataSource(){
QueryWrapper<CoreDatasource> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",985188400292302848L);
queryWrapper.ne("create_time",1715053684176L);
if(!datasourceMapper.exists(queryWrapper) && !ModelUtils.isDesktop()){
Pattern WITH_SQL_FRAGMENT = Pattern.compile("jdbc:mysql://(.*):(\\d+)/(.*)\\?(.*)");
Matcher matcher = WITH_SQL_FRAGMENT.matcher(env.getProperty("spring.datasource.url"));