diff --git a/core/core-backend/src/main/java/io/dataease/chart/server/ChartDataServer.java b/core/core-backend/src/main/java/io/dataease/chart/server/ChartDataServer.java index a86e4bbea9..3f1d231ab5 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/server/ChartDataServer.java +++ b/core/core-backend/src/main/java/io/dataease/chart/server/ChartDataServer.java @@ -128,17 +128,20 @@ public class ChartDataServer implements ChartDataApi { request.setHeader(dsHeader); request.setExcelTypes(dsTypes); } - for (Object[] objects : tableRow) { - for (int i = 0; i < viewDTO.getXAxis().size(); i++) { - if (viewDTO.getXAxis().get(i).getDeType().equals(DeTypeConstants.DE_INT) || viewDTO.getXAxis().get(i).getDeType().equals(DeTypeConstants.DE_FLOAT)) { - try { - objects[i] = valueFormatter(BigDecimal.valueOf(Double.valueOf(objects[i].toString())), viewDTO.getXAxis().get(i).getFormatterCfg()); - } catch (Exception ignore) { + if (CollectionUtils.isNotEmpty(tableRow)) { + for (Object[] objects : tableRow) { + for (int i = 0; i < viewDTO.getXAxis().size(); i++) { + if (viewDTO.getXAxis().get(i).getDeType().equals(DeTypeConstants.DE_INT) || viewDTO.getXAxis().get(i).getDeType().equals(DeTypeConstants.DE_FLOAT)) { + try { + objects[i] = valueFormatter(BigDecimal.valueOf(Double.valueOf(objects[i].toString())), viewDTO.getXAxis().get(i).getFormatterCfg()); + } catch (Exception ignore) { + } } } } } request.setDetails(tableRow); + request.setData(chartViewInfo.getData()); } catch (Exception e) { throw new RuntimeException(e); } 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 7579a284e1..1ab3845ace 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 @@ -483,6 +483,23 @@ public class DatasourceServer implements DatasourceApi { return getDatasourceDTOById(datasourceId, true); } + @Override + public DatasourceDTO getSimpleDs(Long datasourceId) throws DEException { + CoreDatasource datasource = datasourceMapper.selectById(datasourceId); + if (datasource == null) { + DEException.throwException("不存在的数据源!"); + } + if (datasource.getType().equalsIgnoreCase("api")) { + datasource.setConfiguration("[]"); + } else { + datasource.setConfiguration(""); + } + datasource.setConfiguration(""); + DatasourceDTO datasourceDTO = new DatasourceDTO(); + BeanUtils.copyBean(datasourceDTO, datasource); + return datasourceDTO; + } + @Override public DatasourceDTO get(Long datasourceId) throws DEException { return getDatasourceDTOById(datasourceId, false); @@ -1132,8 +1149,12 @@ public class DatasourceServer implements DatasourceApi { params.add(apiDefinition); } } - datasourceDTO.setApiConfigurationStr(new String(Base64.getEncoder().encode(Objects.requireNonNull(JsonUtil.toJSONString(apiDefinitionListWithStatus)).toString().getBytes()))); - datasourceDTO.setParamsStr(new String(Base64.getEncoder().encode(Objects.requireNonNull(JsonUtil.toJSONString(params)).toString().getBytes()))); + if(CollectionUtils.isNotEmpty(params)){ + datasourceDTO.setParamsStr(RsaUtils.symmetricEncrypt(JsonUtil.toJSONString(params).toString())); + } + if(CollectionUtils.isNotEmpty(apiDefinitionListWithStatus)){ + datasourceDTO.setApiConfigurationStr(RsaUtils.symmetricEncrypt(JsonUtil.toJSONString(apiDefinitionListWithStatus).toString())); + } if (success == apiDefinitionList.size()) { datasourceDTO.setStatus("Success"); } else { @@ -1147,7 +1168,6 @@ public class DatasourceServer implements DatasourceApi { TaskDTO taskDTO = new TaskDTO(); BeanUtils.copyBean(taskDTO, coreDatasourceTask); datasourceDTO.setSyncSetting(taskDTO); - CoreDatasourceTask task = datasourceTaskServer.selectByDSId(datasourceDTO.getId()); if (task != null) { datasourceDTO.setLastSyncTime(task.getStartTime()); @@ -1157,13 +1177,12 @@ public class DatasourceServer implements DatasourceApi { Provider provider = ProviderFactory.getProvider(datasourceDTO.getType()); provider.hidePW(datasourceDTO); } - } if (datasourceDTO.getType().equalsIgnoreCase(DatasourceConfiguration.DatasourceType.Excel.toString())) { datasourceDTO.setFileName(ExcelUtils.getFileName(datasource)); datasourceDTO.setSize(ExcelUtils.getSize(datasource)); } - datasourceDTO.setConfiguration(new String(Base64.getEncoder().encode(datasourceDTO.getConfiguration().getBytes()))); + datasourceDTO.setConfiguration(RsaUtils.symmetricEncrypt(datasourceDTO.getConfiguration())); datasourceDTO.setCreator(coreUserManage.getUserName(Long.valueOf(datasourceDTO.getCreateBy()))); return datasourceDTO; } diff --git a/core/core-backend/src/main/java/io/dataease/datasource/server/EngineServer.java b/core/core-backend/src/main/java/io/dataease/datasource/server/EngineServer.java index 788336f184..25c6ea6fbf 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/server/EngineServer.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/server/EngineServer.java @@ -5,9 +5,12 @@ import io.dataease.datasource.dao.auto.entity.CoreDeEngine; import io.dataease.datasource.dao.auto.mapper.CoreDeEngineMapper; import io.dataease.datasource.manage.EngineManage; import io.dataease.datasource.provider.CalciteProvider; +import io.dataease.exception.DEException; import io.dataease.extensions.datasource.dto.DatasourceDTO; +import io.dataease.utils.AuthUtils; import io.dataease.utils.BeanUtils; import io.dataease.utils.IDUtils; +import io.dataease.utils.RsaUtils; import jakarta.annotation.Resource; import org.apache.commons.lang3.StringUtils; import org.springframework.transaction.annotation.Transactional; @@ -30,33 +33,44 @@ public class EngineServer implements EngineApi { @Override public DatasourceDTO getEngine() { + if (!AuthUtils.getUser().getUserId().equals(1L)) { + DEException.throwException("非管理员,无权访问!"); + } DatasourceDTO datasourceDTO = new DatasourceDTO(); List deEngines = deEngineMapper.selectList(null); if (CollectionUtils.isEmpty(deEngines)) { return datasourceDTO; } - return BeanUtils.copyBean(datasourceDTO, deEngines.get(0)); + BeanUtils.copyBean(datasourceDTO, deEngines.get(0)); + datasourceDTO.setConfiguration(RsaUtils.symmetricEncrypt(datasourceDTO.getConfiguration())); + return datasourceDTO; } @Override public void save(DatasourceDTO datasourceDTO) { + if (!AuthUtils.getUser().getUserId().equals(1L)) { + DEException.throwException("非管理员,无权访问!"); + } if (StringUtils.isNotEmpty(datasourceDTO.getConfiguration())) { datasourceDTO.setConfiguration(new String(Base64.getDecoder().decode(datasourceDTO.getConfiguration()))); } CoreDeEngine coreDeEngine = new CoreDeEngine(); BeanUtils.copyBean(coreDeEngine, datasourceDTO); - if(coreDeEngine.getId() == null){ + if (coreDeEngine.getId() == null) { coreDeEngine.setId(IDUtils.snowID()); datasourceDTO.setId(coreDeEngine.getId()); deEngineMapper.insert(coreDeEngine); - }else { + } else { deEngineMapper.updateById(coreDeEngine); } calciteProvider.update(datasourceDTO); } @Override - public void validate(DatasourceDTO datasourceDTO) throws Exception{ + public void validate(DatasourceDTO datasourceDTO) throws Exception { + if (!AuthUtils.getUser().getUserId().equals(1L)) { + DEException.throwException("非管理员,无权访问!"); + } CoreDeEngine coreDeEngine = new CoreDeEngine(); BeanUtils.copyBean(coreDeEngine, datasourceDTO); coreDeEngine.setConfiguration(new String(Base64.getDecoder().decode(coreDeEngine.getConfiguration()))); @@ -65,6 +79,9 @@ public class EngineServer implements EngineApi { @Override public void validateById(Long id) throws Exception { + if (!AuthUtils.getUser().getUserId().equals(1L)) { + DEException.throwException("非管理员,无权访问!"); + } engineManage.validate(deEngineMapper.selectById(id)); } diff --git a/core/core-backend/src/main/java/io/dataease/exportCenter/manage/ExportCenterManage.java b/core/core-backend/src/main/java/io/dataease/exportCenter/manage/ExportCenterManage.java index 894c0c1280..f0e138d4e3 100644 --- a/core/core-backend/src/main/java/io/dataease/exportCenter/manage/ExportCenterManage.java +++ b/core/core-backend/src/main/java/io/dataease/exportCenter/manage/ExportCenterManage.java @@ -655,16 +655,18 @@ public class ExportCenterManage implements BaseExportApi { cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); if (CollectionUtils.isEmpty(request.getMultiInfo())) { - List details = request.getDetails(); - Integer[] excelTypes = request.getExcelTypes(); - details.add(0, request.getHeader()); - ViewDetailField[] detailFields = request.getDetailFields(); - Object[] header = request.getHeader(); + if(request.getViewInfo().getType().equalsIgnoreCase("chart-mix-dual-line")){ - //明细sheet - Sheet detailsSheet = wb.createSheet("数据"); + }else { + List details = request.getDetails(); + Integer[] excelTypes = request.getExcelTypes(); + details.add(0, request.getHeader()); + ViewDetailField[] detailFields = request.getDetailFields(); + Object[] header = request.getHeader(); + Sheet detailsSheet = wb.createSheet("数据"); + ChartDataServer.setExcelData(detailsSheet, cellStyle, header, details, detailFields, excelTypes); + } - ChartDataServer.setExcelData(detailsSheet, cellStyle, header, details, detailFields, excelTypes); } else { //多个sheet for (int i = 0; i < request.getMultiInfo().size(); i++) { diff --git a/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java b/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java index 231afa9d90..701dfa52a0 100644 --- a/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java +++ b/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java @@ -23,6 +23,13 @@ public class RestIndexController { return RsaUtils.publicKey(); } + @GetMapping("/symmetricKey") + @ResponseBody + public String symmetricKey() { + return RsaUtils.generateSymmetricKey(); + } + + @GetMapping("/model") @ResponseBody public boolean model() { diff --git a/core/core-backend/src/main/java/io/dataease/share/interceptor/LinkInterceptor.java b/core/core-backend/src/main/java/io/dataease/share/interceptor/LinkInterceptor.java index 8cdebaf322..9bd36ed94b 100644 --- a/core/core-backend/src/main/java/io/dataease/share/interceptor/LinkInterceptor.java +++ b/core/core-backend/src/main/java/io/dataease/share/interceptor/LinkInterceptor.java @@ -19,7 +19,7 @@ import java.util.List; @Component public class LinkInterceptor implements HandlerInterceptor { - private final static String whiteListText = "/user/ipInfo, /apisix/check, /datasetData/enumValue, /datasetData/enumValueObj, /datasetData/getFieldTree, /dekey, /share/validate, /sysParameter/queryOnlineMap, /chartData/innerExportDetails"; + private final static String whiteListText = "/user/ipInfo, /apisix/check, /datasetData/enumValue, /datasetData/enumValueObj, /datasetData/getFieldTree, /dekey, /symmetricKey, /share/validate, /sysParameter/queryOnlineMap, /chartData/innerExportDetails"; @Override diff --git a/core/core-frontend/src/api/datasource.ts b/core/core-frontend/src/api/datasource.ts index c1997c91c1..751ebb5436 100644 --- a/core/core-frontend/src/api/datasource.ts +++ b/core/core-frontend/src/api/datasource.ts @@ -155,6 +155,8 @@ export const getById = (id: number) => request.get({ url: '/datasource/get/' + i export const getHidePwById = (id: number) => request.get({ url: '/datasource/hidePw/' + id }) +export const getSimpleDs = (id: number) => request.get({ url: '/datasource/getSimpleDs/' + id }) + export const uploadFile = async (data): Promise => { return request .post({ diff --git a/core/core-frontend/src/api/login.ts b/core/core-frontend/src/api/login.ts index 71dd2a9039..a86ccc51bd 100644 --- a/core/core-frontend/src/api/login.ts +++ b/core/core-frontend/src/api/login.ts @@ -4,6 +4,8 @@ export const loginApi = data => request.post({ url: '/login/localLogin', data }) export const queryDekey = () => request.get({ url: 'dekey' }) +export const querySymmetricKey = () => request.get({ url: 'symmetricKey' }) + export const modelApi = () => request.get({ url: 'model' }) export const platformLoginApi = origin => request.post({ url: '/login/platformLogin/' + origin }) diff --git a/core/core-frontend/src/utils/encryption.ts b/core/core-frontend/src/utils/encryption.ts index 3c9b0473a1..11f7fd04f2 100644 --- a/core/core-frontend/src/utils/encryption.ts +++ b/core/core-frontend/src/utils/encryption.ts @@ -40,3 +40,15 @@ export const rsaEncryp = word => { crypt.setKey(pk) return crypt.encrypt(word) } + +export const symmetricDecrypt = (data, keyStr) => { + const iv = CryptoJS.enc.Utf8.parse('0000000000000000') + const key = CryptoJS.enc.Base64.parse(keyStr) + const decodedCiphertext = CryptoJS.enc.Base64.parse(data) + const decrypted = CryptoJS.AES.decrypt({ ciphertext: decodedCiphertext }, key, { + iv: iv, + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7 + }) + return decrypted.toString(CryptoJS.enc.Utf8) +} diff --git a/core/core-frontend/src/views/system/parameter/engine/EngineEdit.vue b/core/core-frontend/src/views/system/parameter/engine/EngineEdit.vue index 585250bd7e..4f0f2f584a 100644 --- a/core/core-frontend/src/views/system/parameter/engine/EngineEdit.vue +++ b/core/core-frontend/src/views/system/parameter/engine/EngineEdit.vue @@ -10,6 +10,8 @@ import { cloneDeep } from 'lodash-es' import { getDeEngine } from '@/api/datasource' import { CustomPassword } from '@/components/custom-password' import { Base64 } from 'js-base64' +import { querySymmetricKey } from '@/api/login' +import { symmetricDecrypt } from '@/utils/encryption' const { t } = useI18n() const dialogVisible = ref(false) const loadingInstance = ref(null) @@ -149,45 +151,47 @@ const defaultInfo = { } const nodeInfo = reactive(cloneDeep(defaultInfo)) const edit = () => { - getDeEngine() - .then(res => { - let { - name, - createBy, - id, - createTime, - creator, - type, - pid, - configuration, - syncSetting, - fileName, - size, - description, - lastSyncTime - } = res.data - if (configuration) { - configuration = JSON.parse(configuration) - } - Object.assign(nodeInfo, { - name, - pid, - description, - fileName, - size, - createTime, - creator, - createBy, - id, - type, - configuration, - syncSetting, - lastSyncTime + querySymmetricKey().then(response => { + getDeEngine() + .then(res => { + let { + name, + createBy, + id, + createTime, + creator, + type, + pid, + configuration, + syncSetting, + fileName, + size, + description, + lastSyncTime + } = res.data + if (configuration) { + configuration = JSON.parse(symmetricDecrypt(configuration, response.data)) + } + Object.assign(nodeInfo, { + name, + pid, + description, + fileName, + size, + createTime, + creator, + createBy, + id, + type, + configuration, + syncSetting, + lastSyncTime + }) }) - }) - .finally(() => { - dialogVisible.value = true - }) + .finally(() => { + dialogVisible.value = true + }) + }) } const basicForm = ref() diff --git a/core/core-frontend/src/views/system/parameter/engine/EngineInfoTemplate.vue b/core/core-frontend/src/views/system/parameter/engine/EngineInfoTemplate.vue index e779e4202b..0d0183b992 100644 --- a/core/core-frontend/src/views/system/parameter/engine/EngineInfoTemplate.vue +++ b/core/core-frontend/src/views/system/parameter/engine/EngineInfoTemplate.vue @@ -42,6 +42,8 @@ import InfoTemplate from '@/views/system/common/InfoTemplate.vue' import { dsTypes } from '@/views/visualized/data/datasource/form/option' import { getDeEngine } from '@/api/datasource' import request from '@/config/axios' +import { querySymmetricKey } from '@/api/login' +import { symmetricDecrypt } from '@/utils/encryption' const { t } = useI18n() const typeMap = dsTypes.reduce((pre, next) => { pre[next.type] = next.name @@ -54,82 +56,82 @@ const infoTemplateTime = ref() const templateList = ref([]) const templateListTime = ref([]) const getEngine = () => { - getDeEngine().then(res => { - let { id, type, configuration } = res.data - if (configuration) { - configuration = JSON.parse(configuration) - } - - nodeInfoId = id - - templateListTime.value = [ - { - pkey: 'datasource.initial_pool_size', - pval: configuration?.initialPoolSize || 5, - type: '', - sort: 0 - }, - { - pkey: 'datasource.min_pool_size', - pval: configuration?.minPoolSize || 5, - type: '', - sort: 0 - }, - { - pkey: 'datasource.max_pool_size', - pval: configuration?.maxPoolSize || 5, - type: '', - sort: 0 - }, - { - pkey: 'datasource.query_timeout', - pval: `${configuration?.queryTimeout || 30}${t('common.second')}`, - type: '', - sort: 0 + querySymmetricKey().then(response => { + getDeEngine().then(res => { + let { id, type, configuration } = res.data + if (configuration) { + configuration = JSON.parse(symmetricDecrypt(configuration, response.data)) } - ] + nodeInfoId = id + templateListTime.value = [ + { + pkey: 'datasource.initial_pool_size', + pval: configuration?.initialPoolSize || 5, + type: '', + sort: 0 + }, + { + pkey: 'datasource.min_pool_size', + pval: configuration?.minPoolSize || 5, + type: '', + sort: 0 + }, + { + pkey: 'datasource.max_pool_size', + pval: configuration?.maxPoolSize || 5, + type: '', + sort: 0 + }, + { + pkey: 'datasource.query_timeout', + pval: `${configuration?.queryTimeout || 30}${t('common.second')}`, + type: '', + sort: 0 + } + ] - templateList.value = [ - { - pkey: t('system.engine_type'), - pval: typeMap[type], - type: '', - sort: 0 - }, - { - pkey: 'datasource.host', - pval: configuration?.host, - type: '', - sort: 0 - }, - { - pkey: 'datasource.port', - pval: configuration?.port, - type: '', - sort: 0 - }, - { - pkey: 'datasource.data_base', - pval: configuration?.dataBase, - type: '', - sort: 0 - }, - { - pkey: 'datasource.user_name', - pval: configuration?.username, - type: '', - sort: 0 - }, - { - pkey: 'datasource.extra_params', - pval: configuration?.extraParams, - type: '', - sort: 0 - } - ] - nextTick(() => { - infoTemplate.value.init() - infoTemplateTime.value.init() + templateList.value = [ + { + pkey: t('system.engine_type'), + pval: typeMap[type], + type: '', + sort: 0 + }, + { + pkey: 'datasource.host', + pval: configuration?.host, + type: '', + sort: 0 + }, + { + pkey: 'datasource.port', + pval: configuration?.port, + type: '', + sort: 0 + }, + { + pkey: 'datasource.data_base', + pval: configuration?.dataBase, + type: '', + sort: 0 + }, + { + pkey: 'datasource.user_name', + pval: configuration?.username, + type: '', + sort: 0 + }, + { + pkey: 'datasource.extra_params', + pval: configuration?.extraParams, + type: '', + sort: 0 + } + ] + nextTick(() => { + infoTemplate.value.init() + infoTemplateTime.value.init() + }) }) }) } diff --git a/core/core-frontend/src/views/visualized/data/datasource/index.vue b/core/core-frontend/src/views/visualized/data/datasource/index.vue index 6cbc0f75b4..dc500a26e9 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue @@ -42,7 +42,13 @@ import { HandleMore } from '@/components/handle-more' import { Icon } from '@/components/icon-custom' import { fieldType } from '@/utils/attr' import { useEmitt } from '@/hooks/web/useEmitt' -import { getHidePwById, listSyncRecord, uploadFile, perDeleteDatasource } from '@/api/datasource' +import { + getHidePwById, + listSyncRecord, + uploadFile, + perDeleteDatasource, + getSimpleDs +} from '@/api/datasource' import CreatDsGroup from './form/CreatDsGroup.vue' import type { Tree } from '../dataset/form/CreatDsGroup.vue' import { previewData, getById } from '@/api/datasource' @@ -81,6 +87,8 @@ import { useEmbedded } from '@/store/modules/embedded' import { XpackComponent } from '@/components/plugin' import { iconFieldMap } from '@/components/icon-group/field-list' import { iconDatasourceMap } from '@/components/icon-group/datasource-list' +import { querySymmetricKey } from '@/api/login' +import { symmetricDecrypt } from '@/utils/encryption' const route = useRoute() const interactiveStore = interactiveStoreWithOut() interface Field { @@ -458,6 +466,7 @@ const saveDsFolder = (params, successCb, finallyCb, cmd) => { const dsLoading = ref(false) const mounted = ref(false) +const symmetricKey = ref('') const listDs = () => { rawDatasourceList.value = [] @@ -550,7 +559,11 @@ const handleNodeClick = data => { dsListTree.value.setCurrentKey(null) return } - return getHidePwById(data.id).then(res => { + let method = getHidePwById + if (data.weight < 7) { + method = getSimpleDs + } + return method(data.id).then(res => { let { name, createBy, @@ -570,13 +583,13 @@ const handleNodeClick = data => { enableDataFill } = res.data if (configuration) { - configuration = JSON.parse(Base64.decode(configuration)) - } - if (apiConfigurationStr) { - apiConfigurationStr = JSON.parse(Base64.decode(apiConfigurationStr)) + configuration = JSON.parse(symmetricDecrypt(configuration, symmetricKey.value)) } if (paramsStr) { - paramsStr = JSON.parse(Base64.decode(paramsStr)) + paramsStr = JSON.parse(symmetricDecrypt(paramsStr, symmetricKey.value)) + } + if (apiConfigurationStr) { + apiConfigurationStr = JSON.parse(symmetricDecrypt(apiConfigurationStr, symmetricKey.value)) } Object.assign(nodeInfo, { name, @@ -697,13 +710,13 @@ const editDatasource = (editType?: number) => { enableDataFill } = res.data if (configuration) { - configuration = JSON.parse(Base64.decode(configuration)) + configuration = JSON.parse(symmetricDecrypt(configuration, symmetricKey.value)) } if (paramsStr) { - paramsStr = JSON.parse(Base64.decode(paramsStr)) + paramsStr = JSON.parse(symmetricDecrypt(paramsStr, symmetricKey.value)) } if (apiConfigurationStr) { - apiConfigurationStr = JSON.parse(Base64.decode(apiConfigurationStr)) + apiConfigurationStr = JSON.parse(symmetricDecrypt(apiConfigurationStr, symmetricKey.value)) } let datasource = reactive(cloneDeep(defaultInfo)) Object.assign(datasource, { @@ -762,13 +775,13 @@ const handleCopy = async data => { lastSyncTime } = res.data if (configuration) { - configuration = JSON.parse(Base64.decode(configuration)) + configuration = JSON.parse(symmetricDecrypt(configuration, symmetricKey.value)) } if (paramsStr) { - paramsStr = JSON.parse(Base64.decode(paramsStr)) + paramsStr = JSON.parse(symmetricDecrypt(paramsStr, symmetricKey.value)) } if (apiConfigurationStr) { - apiConfigurationStr = JSON.parse(Base64.decode(apiConfigurationStr)) + apiConfigurationStr = JSON.parse(symmetricDecrypt(apiConfigurationStr, symmetricKey.value)) } let datasource = reactive(cloneDeep(defaultInfo)) Object.assign(datasource, { @@ -901,6 +914,7 @@ const operation = (cmd: string, data: Tree, nodeType: string) => { const handleClick = (tabName: TabPaneName) => { switch (tabName) { case 'config': + tableData.value = [] listDatasourceTables({ datasourceId: nodeInfo.id }).then(res => { tabList.value = res.data.map(ele => { const { name, tableName } = ele @@ -979,6 +993,9 @@ onMounted(() => { if (opt && opt === 'create') { datasourceEditor.value.init(null, null) } + querySymmetricKey().then(res => { + symmetricKey.value = res.data + }) }) const sideTreeStatus = ref(true) @@ -1433,7 +1450,9 @@ const getMenuList = (val: boolean) => { }} - -