复制外链图片, 下载到本地

https://github.com/leanote/desktop-app/issues/65
This commit is contained in:
life
2015-10-19 14:47:09 +08:00
parent a669f0750a
commit 4bb3dd5750
4 changed files with 41 additions and 44 deletions

21
node_modules/file.js generated vendored
View File

@@ -589,8 +589,27 @@ var File = {
}
});
}
},
// 复制外站图片
copyOtherSiteImage: function(src, callback) {
var me = this;
me.downloadImg(src, function (filePath) {
if (filePath) {
me._addImage(Common.objectId(), filePath, function(file) {
if (file) {
callback(Evt.getImageLocalUrl(file.FileId));
}
else {
callback(false);
}
});
}
else {
callback(false);
}
});
}
};
module.exports = File;