diff --git a/doc/webservice/新版websdk接口说明.doc b/doc/webservice/新版websdk接口说明.doc index 6d43922c..6e9c45fc 100644 Binary files a/doc/webservice/新版websdk接口说明.doc and b/doc/webservice/新版websdk接口说明.doc differ diff --git a/sdk/webservice/ManagerV2.cpp b/sdk/webservice/ManagerV2.cpp index 408f6431..b88fd30d 100644 --- a/sdk/webservice/ManagerV2.cpp +++ b/sdk/webservice/ManagerV2.cpp @@ -746,7 +746,7 @@ namespace ver_2 } int ManagerV2::LocalMakeZipFile(const std::vector& filePathList, const std::vector& nameList, - bool temp, std::string& outZipPath, std::string& errInfo) + const std::string &zipPath, bool temp, std::string& outZipPath, std::string& errInfo) { outZipPath.clear(); errInfo = "错误"; @@ -766,6 +766,8 @@ namespace ver_2 } std::string outZipPath2 = GetFilePath(temp, "zip"); + if (!zipPath.empty()) + outZipPath2 = zipPath; int error = 0; zip* z = zip_open(StdStringToUtf8(outZipPath2).c_str(), ZIP_CREATE | ZIP_TRUNCATE, &error); diff --git a/sdk/webservice/ManagerV2.h b/sdk/webservice/ManagerV2.h index af014d9c..0cbfa402 100644 --- a/sdk/webservice/ManagerV2.h +++ b/sdk/webservice/ManagerV2.h @@ -160,7 +160,7 @@ namespace ver_2 std::vector& outImagePathList, std::string& errInfo); // 本地生成压缩文件 int LocalMakeZipFile(const std::vector& filePathList, const std::vector& nameList, - bool temp, std::string& outZipPath, std::string& errInfo); + const std::string &zipPath, bool temp, std::string& outZipPath, std::string& errInfo); // 本地图像纠偏 int LocalImageDeskew(const std::string& imagePath, bool autoCrop, bool deskew, bool fillBlank, int width, int height, bool temp, std::string& outImagePath, std::string& errInfo); diff --git a/sdk/webservice/WSUser.cpp b/sdk/webservice/WSUser.cpp index eb5c7fdc..648eb50a 100644 --- a/sdk/webservice/WSUser.cpp +++ b/sdk/webservice/WSUser.cpp @@ -1732,9 +1732,11 @@ namespace ver_2 } } + std::string zipPath = GetJsonStringValue(json, "zip_path"); + std::string outZipPath; std::string errInfo; - int ret = GetManager()->LocalMakeZipFile(filePathList, nameList, !localSave, outZipPath, errInfo); + int ret = GetManager()->LocalMakeZipFile(filePathList, nameList, zipPath, !localSave, outZipPath, errInfo); if ("make_zip_file" == func || "base64_make_zip_file" == func) { diff --git a/test/webservice/demo.html b/test/webservice/demo.html index 05f88bf2..a50c168b 100644 --- a/test/webservice/demo.html +++ b/test/webservice/demo.html @@ -444,7 +444,8 @@ socket.send(JSON.stringify({ 'func':'local_make_zip_file', 'file_path_list':['D:\\1.jpg','D:\\2.jpg'], - 'local_save':false, + 'local_save':true, + 'zip_path':'D:\\1.zip', 'get_base64':true })); }