From cb852181fc2bbf2fb7143ff1a6cbaa2434afc566 Mon Sep 17 00:00:00 2001 From: T2492 Date: Wed, 10 Apr 2024 16:23:11 +0800 Subject: [PATCH] =?UTF-8?q?issue:11943=EF=BC=88=E4=BF=9D=E5=AD=98=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E7=94=A8=E6=88=B7=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/server/controller/ConfigController.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java index ffb79f32e35..d10aa0dacbf 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java @@ -634,9 +634,9 @@ public RestResult> importAndPublishConfig(HttpServletRequest RestResult> errorResult; if (metaDataZipItem != null && Constants.CONFIG_EXPORT_METADATA_NEW.equals(metaDataZipItem.getItemName())) { // new export - errorResult = parseImportDataV2(unziped, configInfoList, unrecognizedList, namespace); + errorResult = parseImportDataV2(srcUser, unziped, configInfoList, unrecognizedList, namespace); } else { - errorResult = parseImportData(unziped, configInfoList, unrecognizedList, namespace); + errorResult = parseImportData(srcUser, unziped, configInfoList, unrecognizedList, namespace); } if (errorResult != null) { return errorResult; @@ -682,7 +682,7 @@ public RestResult> importAndPublishConfig(HttpServletRequest * @param namespace import namespace. * @return error result. */ - private RestResult> parseImportData(ZipUtils.UnZipResult unziped, + private RestResult> parseImportData(String srcUser, ZipUtils.UnZipResult unziped, List configInfoList, List> unrecognizedList, String namespace) { ZipUtils.ZipItem metaDataZipItem = unziped.getMetaDataItem(); @@ -735,6 +735,7 @@ private RestResult> parseImportData(ZipUtils.UnZipResult unz } ci.setTenant(namespace); ci.setEncryptedDataKey(pair.getFirst()); + ci.setCreateUser(srcUser); configInfoList.add(ci); } } @@ -750,7 +751,7 @@ private RestResult> parseImportData(ZipUtils.UnZipResult unz * @param namespace import namespace. * @return error result. */ - private RestResult> parseImportDataV2(ZipUtils.UnZipResult unziped, + private RestResult> parseImportDataV2(String srcUser, ZipUtils.UnZipResult unziped, List configInfoList, List> unrecognizedList, String namespace) { ZipUtils.ZipItem metaDataItem = unziped.getMetaDataItem(); String metaData = metaDataItem.getItemData(); @@ -826,6 +827,7 @@ private RestResult> parseImportDataV2(ZipUtils.UnZipResult u ci.setAppName(configExportItem.getAppName()); ci.setTenant(namespace); ci.setEncryptedDataKey(pair.getFirst()); + ci.setCreateUser(srcUser); configInfoList.add(ci); } return null;