fix: API 数据集同步错误

This commit is contained in:
taojinlong 2022-02-23 17:43:28 +08:00
parent b1100a01e4
commit 85012cb42e
2 changed files with 2 additions and 2 deletions

View File

@ -185,7 +185,7 @@ public class ApiProvider extends DatasourceProvider{
int i = 0;
while (it.hasNext()){
Map.Entry entry = (Map.Entry)it.next();
row[i] = Optional.ofNullable(entry.getValue()).orElse("").toString();
row[i] = Optional.ofNullable(entry.getValue()).orElse("").toString().replaceAll("\n", " ").replaceAll("\r", " ");
i++;
}
dataList.add(row);

View File

@ -310,7 +310,7 @@ public class DatasourceService {
Iterator it = data.entrySet().iterator();
while (it.hasNext()){
Map.Entry entry = (Map.Entry)it.next();
jsonObject.put((String) entry.getKey(), entry.getValue());
jsonObject.put((String) entry.getKey(), Optional.ofNullable(entry.getValue()).orElse("").toString().replaceAll("\n", " ").replaceAll("\r", " "));
if(getFileds) {
DatasetTableField tableField = new DatasetTableField();
tableField.setOriginName((String) entry.getKey());