Commit 8f561376 by 王悦

fix

parent 9e35f6cb
...@@ -25,7 +25,6 @@ class searchCtl extends CtlBase { ...@@ -25,7 +25,6 @@ class searchCtl extends CtlBase {
* {"error": ""} * {"error": ""}
*/ */
async findAndCountAll(p, q, req) { async findAndCountAll(p, q, req) {
try {
let query = { let query = {
"actionType": "", "actionType": "",
"actionBody": { "actionBody": {
...@@ -54,13 +53,15 @@ class searchCtl extends CtlBase { ...@@ -54,13 +53,15 @@ class searchCtl extends CtlBase {
query.actionBody.tmName = p.search.sbmc query.actionBody.tmName = p.search.sbmc
} }
} else return; } else return;
}catch (e) {
return system.getResultFail(-8,e)
}
try {
let tokenInfo = await this.service.getToken(); let tokenInfo = await this.service.getToken();
try {
let rtn = await this.execClient.execPostTK(query, tmurl, tokenInfo.data.token); let rtn = await this.execClient.execPostTK(query, tmurl, tokenInfo.data.token);
let data = rtn.data; let data = rtn.data;
} catch (e) {
return system.getResultFail(-8, e)
}
try {
let published = await this.service.findAll({company_id: p.company_id}); let published = await this.service.findAll({company_id: p.company_id});
data.rows.forEach(item => { data.rows.forEach(item => {
for (let t of published) { for (let t of published) {
...@@ -69,8 +70,8 @@ class searchCtl extends CtlBase { ...@@ -69,8 +70,8 @@ class searchCtl extends CtlBase {
} }
}); });
return system.getResultList(data.count, data.rows) return system.getResultList(data.count, data.rows)
}catch (e) { } catch (e) {
return system.getResultFail(-9,e) return system.getResultFail(-9, e)
} }
} }
} }
......
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