mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-17 00:15:12 +00:00
JSON.stringify params ipc send
This commit is contained in:
5
node_modules/nedb_proxy.js
generated
vendored
5
node_modules/nedb_proxy.js
generated
vendored
@@ -33,7 +33,8 @@ DBProxy.prototype.send = function(params, callback, method) {
|
||||
token: token,
|
||||
method: method,
|
||||
dbname: this.dbname,
|
||||
params: params
|
||||
// 转为json字符串, 如果{[a], [a]}, 在main接收后变成了 {[a], [null]}, 对象引用问题
|
||||
params: params ? JSON.stringify(params) : ''
|
||||
}
|
||||
token2Callback[token] = callback;
|
||||
ipc.send('db-exec', m);
|
||||
@@ -43,6 +44,8 @@ DBProxy.prototype.send = function(params, callback, method) {
|
||||
// Notes.find(query).sort({'UpdatedTime': -1}).exec(function(err, notes) {
|
||||
DBProxy.prototype.find = function (params, callback) {
|
||||
if (callback) {
|
||||
// console.log('client');
|
||||
// console.log(params);
|
||||
this.send({query: params}, callback, 'find');
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user