mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-21 03:11:18 +00:00
0.3.4
This commit is contained in:
18
src/node_modules/file.js
generated
vendored
18
src/node_modules/file.js
generated
vendored
@@ -377,16 +377,16 @@ var File = {
|
||||
|
||||
// 访问api, 得到图片
|
||||
function getImageFromApi() {
|
||||
console.log('fetch servers image ' + fileId);
|
||||
// console.log('fetch servers image ' + fileId);
|
||||
Api.getImage(fileId, function(fileLocalPath, filename) {
|
||||
if(fileLocalPath) {
|
||||
console.log('save image to local');
|
||||
// console.log('save image to local');
|
||||
// 保存到本地数据库中
|
||||
me.addImageForce(fileId, fileLocalPath, function(doc) {
|
||||
if(doc) {
|
||||
console.log('save image to local success');
|
||||
// console.log('save image to local success');
|
||||
} else {
|
||||
console.log('save image to local error');
|
||||
// console.log('save image to local error');
|
||||
}
|
||||
callback(fileLocalPath);
|
||||
// return me.retImage(fileLocalPath, res);
|
||||
@@ -394,8 +394,8 @@ var File = {
|
||||
} else {
|
||||
// 远程取不到图片, 是没有网络? 还是远程真的没有了
|
||||
// TODO
|
||||
console.log("cann't get server's image" + fileId);
|
||||
callback(false);
|
||||
// console.log("cann't get server's image" + fileId);
|
||||
// callback(false);
|
||||
// return me.e404(res);
|
||||
}
|
||||
});
|
||||
@@ -404,13 +404,13 @@ var File = {
|
||||
// has表示本地数据库有记录
|
||||
me.getImageLocalPath(fileId, function(has, fileLocalPath) {
|
||||
// 本地有
|
||||
console.log('re img')
|
||||
console.log(fileLocalPath);
|
||||
// console.log('re img')
|
||||
// console.log(fileLocalPath);
|
||||
// console.log(fs.exists(fileLocalPath));
|
||||
if(has && fileLocalPath) {
|
||||
fs.exists(fileLocalPath, function(exists) {
|
||||
if(exists) {
|
||||
console.log('本地存在');
|
||||
// console.log('本地存在');
|
||||
callback(fileLocalPath);
|
||||
// me.retImage(fileLocalPath, res);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user