diff --git a/source/_posts/linux/博客图片迁移记.md b/source/_posts/linux/博客图片迁移记.md index 2b6b656..e7572a8 100644 --- a/source/_posts/linux/博客图片迁移记.md +++ b/source/_posts/linux/博客图片迁移记.md @@ -169,11 +169,12 @@ function uploadObject(filesList, index) { body: fs.createReadStream(path.resolve(rootPath, filesList[index].name)), // 支持 Buffer/Readable/string }).then(result => { // eTag是上传后远端校验的md5值, 用于和本地进行比对 - if(filesList[index].md5 === result.eTag) { - console.log(`${filesList[index].name} 上传成功, md5:${result.eTag} 类型: ${item.type}`) + let eTag = result.eTag.replace(/"/g,'') + if(filesList[index].md5 === eTag) { + console.log(`${filesList[index].name} 上传成功, md5:${eTag} 类型: ${filesList[index].type}`) } else { console.warn(`${filesList[index].name} 上传出错, md5值不一致`) - console.warn(`===> 本地文件: ${item.md5}, 接口返回: ${result.eTag}`) + console.warn(`===> 本地文件: ${filesList[index].md5}, 接口返回: ${eTag}`) } uploadObject.call(this, filesList, ++index) })