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