mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-16 08:01:53 +00:00
写作模式, sync问题
This commit is contained in:
12
node_modules/file.js
generated
vendored
12
node_modules/file.js
generated
vendored
@@ -258,16 +258,16 @@ var File = {
|
||||
|
||||
// 访问api, 得到图片
|
||||
function getImageFromApi() {
|
||||
log('从远程得到图片 ' + fileId);
|
||||
console.log('fetch servers image ' + fileId);
|
||||
Api.getImage(fileId, function(fileLocalPath, filename) {
|
||||
if(fileLocalPath) {
|
||||
log('图片保存到本地成功');
|
||||
console.log('save image to local');
|
||||
// 保存到本地数据库中
|
||||
me.addImageForce(fileId, fileLocalPath, function(doc) {
|
||||
if(doc) {
|
||||
log('保存到本地数据库成功');
|
||||
console.log('save image to local success');
|
||||
} else {
|
||||
log('保存到数据库失败');
|
||||
console.log('save image to local error');
|
||||
}
|
||||
callback(fileLocalPath);
|
||||
// return me.retImage(fileLocalPath, res);
|
||||
@@ -275,7 +275,7 @@ var File = {
|
||||
} else {
|
||||
// 远程取不到图片, 是没有网络? 还是远程真的没有了
|
||||
// TODO
|
||||
log('取不远程的图片' + fileId);
|
||||
console.log("cann't get server's image" + fileId);
|
||||
callback(false);
|
||||
// return me.e404(res);
|
||||
}
|
||||
@@ -285,7 +285,7 @@ var File = {
|
||||
// has表示本地数据库有记录
|
||||
me.getImageLocalPath(fileId, function(has, fileLocalPath) {
|
||||
// 本地有
|
||||
log('re img')
|
||||
console.log('re img')
|
||||
console.log(fileLocalPath);
|
||||
// console.log(fs.exists(fileLocalPath));
|
||||
if(has && fileLocalPath) {
|
||||
|
Reference in New Issue
Block a user