diff --git a/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java b/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java index 90d446af2b..563590534b 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java @@ -423,7 +423,7 @@ public class ExcelUtils { if (remoteExcelRequest.getUrl().trim().startsWith("http")) { HttpClientConfig httpClientConfig = new HttpClientConfig(); if (StringUtils.isNotEmpty(remoteExcelRequest.getUserName()) && StringUtils.isNotEmpty(remoteExcelRequest.getPasswd())) { - String authValue = "Basic " + Base64.getUrlEncoder().encodeToString((new String(Base64.getDecoder().decode(remoteExcelRequest.getUserName())) + ":" + new String(Base64.getDecoder().decode(remoteExcelRequest.getPasswd()))).getBytes()); + String authValue = "Basic " + Base64.getUrlEncoder().encodeToString((remoteExcelRequest.getUserName() + ":" + remoteExcelRequest.getPasswd()).getBytes()); httpClientConfig.addHeader("Authorization", authValue); } File p = new File(path); @@ -756,8 +756,8 @@ public class ExcelUtils { } } if (StringUtils.isNotEmpty(remoteExcelRequest.getUserName()) && StringUtils.isNotEmpty(remoteExcelRequest.getPasswd())) { - username = new String(Base64.getDecoder().decode(remoteExcelRequest.getUserName())); - password = new String(Base64.getDecoder().decode(remoteExcelRequest.getPasswd())); + username = remoteExcelRequest.getUserName(); + password = remoteExcelRequest.getPasswd(); } filePath = filePath.startsWith("/") ? filePath.substring(1) : filePath; int port = 21; diff --git a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java index 9a357425f9..db964efc4e 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java @@ -889,6 +889,8 @@ public class DatasourceServer implements DatasourceApi { } public ExcelFileData loadRemoteFile(RemoteExcelRequest remoteExcelRequest) throws DEException, IOException { + remoteExcelRequest.setUserName(new String(Base64.getDecoder().decode(remoteExcelRequest.getUserName()))); + remoteExcelRequest.setPasswd(new String(Base64.getDecoder().decode(remoteExcelRequest.getPasswd()))); ExcelFileData excelFileData = new ExcelUtils().parseRemoteExcel(remoteExcelRequest); CoreDatasource coreDatasource = null; if (ObjectUtils.isNotEmpty(remoteExcelRequest.getDatasourceId()) && 0L != remoteExcelRequest.getDatasourceId()) { diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/index.vue b/core/core-frontend/src/views/visualized/data/datasource/form/index.vue index 1f8cc7a382..029de4be8a 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/form/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/form/index.vue @@ -504,7 +504,7 @@ const saveDS = () => { const validateApi = excelRemote?.value?.submitSyncSettingForm() validateApi(v => { if (v) { - if (editDs.value) { + if (editDs.value && form2.id) { complete(null, null, null) } else { creatDsFolder.value.createInit('datasource', { id: pid.value }, '', form2.name) @@ -691,6 +691,8 @@ const init = (nodeInfo: Form | Param, id?: string, res?: object, supportSetKey: Object.assign(form, cloneDeep(defaultForm)) pid.value = id || '0' } + console.log(nodeInfo) + console.log(pid.value) activeStep.value = Number(editDs.value) activeApiStep.value = activeStep.value