Commit b1fc27e3 by 任晓松

tj

parent 5c98671d
......@@ -27,7 +27,7 @@ class LaunchchannelService extends ServiceBase {
}
let searchResult = await this.findOne(whereParams,[]);
if(searchResult){
return system.getResultFail(-1,'当前渠道已经存在,请勿重复添加')
return null;
}
let channelData = {
name:pobj.name,
......@@ -37,7 +37,7 @@ class LaunchchannelService extends ServiceBase {
company_id:pobj.company_id
}
let result= await this.create(channelData);
return system.getResult(result);
return result;
}
}
......
......@@ -131,10 +131,10 @@ class System {
* @param {*} okmsg 操作成功的描述
* @param {*} req 请求头信息
*/
static getResult(data, opmsg = "操作成功", req) {
static getResult(data, opmsg, req) {
return {
status: !data ? -1 : 0,
msg: opmsg,
msg: data ?'操作成功': '操作失败',
data: data,
bizmsg: req && req.session && req.session.bizmsg ? req.session.bizmsg : "empty"
};
......
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