Commit bebbf222 by 王悦

fix

parent 4ca345c2
...@@ -6,6 +6,7 @@ const CtlBase = require("../../ctl.base"); ...@@ -6,6 +6,7 @@ const CtlBase = require("../../ctl.base");
const logCtl = system.getObject("web.common.oplogCtl"); const logCtl = system.getObject("web.common.oplogCtl");
const tmtransactionPath = "/api/action/tmQuery/springBoard"; const tmtransactionPath = "/api/action/tmQuery/springBoard";
const tmurl = settings.channelApiUrl() + tmtransactionPath; const tmurl = settings.channelApiUrl() + tmtransactionPath;
//标源检索 //标源检索
class searchCtl extends CtlBase { class searchCtl extends CtlBase {
constructor() { constructor() {
...@@ -24,8 +25,6 @@ class searchCtl extends CtlBase { ...@@ -24,8 +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": {
...@@ -55,6 +54,8 @@ class searchCtl extends CtlBase { ...@@ -55,6 +54,8 @@ class searchCtl extends CtlBase {
} }
} else return; } else return;
let tokenInfo = await this.service.getToken(); let tokenInfo = await this.service.getToken();
if (tokenInfo && tokenInfo.data && tokenInfo.data.token) {
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;
let published = await this.service.findAll({company_id: p.company_id}); let published = await this.service.findAll({company_id: p.company_id});
...@@ -64,10 +65,11 @@ class searchCtl extends CtlBase { ...@@ -64,10 +65,11 @@ class searchCtl extends CtlBase {
item._disabled = true; item._disabled = true;
} }
}); });
return system.getResultList(data.count, data.rows)
}catch (e) { }catch (e) {
return system.getResultFail(-1, e) return system.getResultFail(-1,e)
} }
return system.getResultList(data.count, data.rows)
} else return system.getResultFail(-1, "token获取失败")
} }
} }
......
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