fix(数据源): 超时时间无法修改

This commit is contained in:
taojinlong 2022-07-03 22:02:01 +08:00
parent c100179997
commit 4474970b2d
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,7 @@
package io.dataease.service.datasource;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
@ -140,6 +142,11 @@ public class DatasourceService {
if (StringUtils.isNotEmpty(configuration.getCustomDriver()) && !configuration.getCustomDriver().equalsIgnoreCase("default")) {
datasourceDTO.setCalculationMode(DatasourceCalculationMode.DIRECT);
}
JSONObject jsonObject = JSONObject.parseObject(datasourceDTO.getConfiguration());
if(jsonObject.getString("queryTimeout") == null){
jsonObject.put("queryTimeout", 30);
datasourceDTO.setConfiguration(jsonObject.toString());
}
}
if(datasourceDTO.getType().equalsIgnoreCase(DatasourceTypes.mysql.toString())){

View File

@ -319,9 +319,6 @@ export default {
} else {
this.form.configuration = JSON.parse(this.form.configuration)
if(this.form.configuration.queryTimeout === undefined){
this.form.configuration.queryTimeout = 30
}
}
this.disabled = this.params && this.params.id && this.params.showModel && this.params.showModel === 'show' && !this.canEdit
},