mirror of
https://github.com/leanote/desktop-app.git
synced 2025-12-21 01:07:43 +08:00
本地添加图片成功, add resource 待完善
This commit is contained in:
9
node_modules/api.js
generated
vendored
9
node_modules/api.js
generated
vendored
@@ -86,13 +86,17 @@ var Api = {
|
||||
fs.writeFile('/Users/life/Desktop/aa.png', resp.body);
|
||||
});
|
||||
},
|
||||
// 测试
|
||||
uploadImage: function() {
|
||||
var data = {
|
||||
foo: 'bar',
|
||||
image: { file: '/Users/life/Desktop/aa.png', content_type: 'image/png' }
|
||||
cc: [1,2,3,3],
|
||||
dd: {name: 'life', age: 18},
|
||||
image: { file: '/Users/life/Desktop/imageplus.png', content_type: 'image/png' }
|
||||
}
|
||||
needle.post('http://localhost/phpinfo.php', data, { multipart: true }, function(err, resp, body) {
|
||||
// needle will read the file and include it in the form-data as binary
|
||||
console.log(resp.body);
|
||||
});
|
||||
},
|
||||
getSyncNotebooks: function(afterUsn, maxEntry, callback) {
|
||||
@@ -338,7 +342,8 @@ var Api = {
|
||||
});
|
||||
},
|
||||
|
||||
// 添加
|
||||
// 添加笔记
|
||||
// 要把文件也发送过去
|
||||
addNote: function(note, callback) {
|
||||
var me = this;
|
||||
// note.NotebookId是本的, 要得到远程的
|
||||
|
||||
Reference in New Issue
Block a user