Commit 8099cc6a authored by antoor's avatar antoor

Add updateHttpConf features

增加更新HTTP配置API
parent a57824ef
...@@ -40,7 +40,8 @@ class Database { ...@@ -40,7 +40,8 @@ class Database {
.on('shell-editDataConf', this.editDataConf.bind(this)) .on('shell-editDataConf', this.editDataConf.bind(this))
.on('shell-delDataConf', this.delDataConf.bind(this)) .on('shell-delDataConf', this.delDataConf.bind(this))
.on('shell-getDataConf', this.getDataConf.bind(this)) .on('shell-getDataConf', this.getDataConf.bind(this))
.on('shell-renameCategory', this.renameShellCategory.bind(this)); .on('shell-renameCategory', this.renameShellCategory.bind(this))
.on('shell-updateHttpConf', this.updateHttpConf.bind(this));
} }
/** /**
...@@ -176,6 +177,27 @@ class Database { ...@@ -176,6 +177,27 @@ class Database {
}); });
} }
/**
* 更新httpConf配置信息(包含body&&headers
* @param {[type]} event [description]
* @param {[type]} opt = {} [description]
* @return {[type]} [description]
*/
updateHttpConf(event, opt = {}) {
logger.warn('updateHttpConf', opt);
this.cursor.update({
_id: opt._id
}, {
$set: {
httpConf: opt.conf,
utime: +new Date
}
}, (_err, _ret) => {
event.returnValue = _err || _ret;
});
}
/** /**
* 删除shell数据 * 删除shell数据
* @param {Object} event ipcMain对象 * @param {Object} event ipcMain对象
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment