diff --git a/deploy_utils/image_synchronize.js b/deploy_utils/image_synchronize.js index 0f35951..5363d59 100644 --- a/deploy_utils/image_synchronize.js +++ b/deploy_utils/image_synchronize.js @@ -55,11 +55,11 @@ class ImageSynchronizer { item.type = 'new' return true } - else if (storageItems[index].eTag !== item.md5) { - // 文件名存在, 但是hash值不同, 代表有变化 - item.type = 'change' - return true - } + // else if (storageItems[index].eTag !== item.md5) { + // // 文件名存在, 但是hash值不同, 代表有变化 + // item.type = 'change' + // return true + // } return false }); // 处理待上传的文件 @@ -85,12 +85,12 @@ class ImageSynchronizer { }).then(result => { // eTag是上传后远端校验的md5值, 用于和本地进行比对 let eTag = result.eTag.replace(/"/g,'') - if(filesList[index].md5 === eTag) { + // if(filesList[index].md5 === eTag) { console.log(`${filesList[index].name} 上传成功, md5:${eTag} 类型: ${filesList[index].type}`) - } else { - console.warn(`${filesList[index].name} 上传出错, md5值不一致`) - console.warn(`===> 本地文件: ${filesList[index].md5}, 接口返回: ${eTag}`) - } + // } else { + // console.warn(`${filesList[index].name} 上传出错, md5值不一致`) + // console.warn(`===> 本地文件: ${filesList[index].md5}, 接口返回: ${eTag}`) + // } this._uploadObject(filesList, ++index) }) } diff --git a/deploy_utils/list_images.js b/deploy_utils/list_images.js index c417dc0..69d8c09 100644 --- a/deploy_utils/list_images.js +++ b/deploy_utils/list_images.js @@ -17,12 +17,12 @@ function readDirSync(imageFolderPath, images, rootPath){ readDirSync(`${imageFolderPath}/${item}`, images, rootPath) }else{ //读取一个Buffer - let buffer = fs.readFileSync(`${imageFolderPath}/${item}`) - let fsHash = crypto.createHash('md5') - fsHash.update(buffer) + // let buffer = fs.readFileSync(`${imageFolderPath}/${item}`) + // let fsHash = crypto.createHash('md5') + // fsHash.update(buffer) images.push({ name: `${imageFolderPath}/${item}`.replace(rootPath, ''), - md5: fsHash.digest('hex') + // md5: fsHash.digest('hex') }) } })