diff --git a/src/node_modules/file.js b/src/node_modules/file.js index 3d90e8f8..38f9b105 100644 --- a/src/node_modules/file.js +++ b/src/node_modules/file.js @@ -37,6 +37,7 @@ var File = { var filename = Common.uuid() + '.' + type; if(isImage) { var basePath = User.getCurUserImagesPath(); + } else { var basePath = User.getCurUserAttachsPath(); } @@ -86,10 +87,11 @@ var File = { } }); */ - + // console.log(txtPath); + // console.log(filePath); Common.cmd([txtPath, filePath], function(code) { - console.log('子进程已关闭,代码:' + code); - fs.unlink(txtPath); + // console.log('子进程已关闭,代码:' + code); + // fs.unlink(txtPath); if(!code) { try { if(isImage) { @@ -101,6 +103,7 @@ var File = { me._addAttach(filePath, fileTitle, callback) } } catch(e) { + console.log(e); callback(false); } } else { diff --git a/src/node_modules/import.js b/src/node_modules/import.js index 9b7c9b41..1f3f6fdd 100755 --- a/src/node_modules/import.js +++ b/src/node_modules/import.js @@ -36,7 +36,7 @@ var Import = { if(!content) { return ''; } - var reg = new RegExp("", "g"); + var reg = new RegExp("", "g"); // var i = 0; // console.log(content); while(ret = reg.exec(content)) { @@ -59,6 +59,10 @@ var Import = { }; }; + // 如果是, 匹配不到 + content = content.replace(/<\/en-media>/g, ''); + + return content; }, @@ -83,6 +87,9 @@ var Import = { var resources = note['resource'] || []; var parsedRes = []; var attachs = []; + console.log("-----------") + console.log(note); + console.log(resources); async.eachSeries(resources, function(res, cb) { // console.log(res['data'][0]['$']); /*