mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-16 08:01:53 +00:00
12
node_modules/file.js
generated
vendored
12
node_modules/file.js
generated
vendored
@@ -683,8 +683,9 @@ var File = {
|
||||
date: 'Mon, 19 Jan 2015 15:01:47 GMT',
|
||||
*/
|
||||
// log(resp.headers);
|
||||
if(err || !resp || resp.statusCode == 404) {
|
||||
if(err || !resp || resp.statusCode != 200) {
|
||||
callback(false);
|
||||
return;
|
||||
} else {
|
||||
// 当图片没有时候还是执行这一步
|
||||
|
||||
@@ -697,6 +698,12 @@ var File = {
|
||||
}
|
||||
}
|
||||
|
||||
// 返回的是字符串, 肯定是403之类的
|
||||
if (typeof resp.body === 'string') {
|
||||
callback(false);
|
||||
return;
|
||||
}
|
||||
|
||||
var filename = Common.uuid() + '.' + type;
|
||||
var imagePath = User.getCurUserImagesPath();
|
||||
var imagePathAll = imagePath + '/' + filename;
|
||||
@@ -715,7 +722,10 @@ var File = {
|
||||
// 复制外站图片
|
||||
copyOtherSiteImage: function(src, callback) {
|
||||
var me = this;
|
||||
console.log('copyOtherSiteImage');
|
||||
console.log(src);
|
||||
me.downloadImg(src, function (filePath) {
|
||||
console.log(filePath);
|
||||
if (filePath) {
|
||||
me._addImage(Common.objectId(), filePath, function(file) {
|
||||
if (file) {
|
||||
|
Reference in New Issue
Block a user