Commit fcc22bf3 by sxy

feat: 权限

parent 8222d6ed
......@@ -51,7 +51,15 @@ class CtlBase {
credid: req.headers["x-credential-identifier"],
regrole: req.headers["xregrole"],
bizpath: req.headers["xbizpath"],
opath: req.headers['xopath'],
ptags: req.headers['xptags'],
}
if (req.xctx.ptags && req.xctx.ptags != "") {
pobj.opath = req.xctx.ptags
} else {
pobj.opath = req.xctx.opath
}
if (!req.xctx.appkey) {
return [-200, "请求头缺少应用x-app-key"]
} else {
......
......@@ -10,6 +10,14 @@ class BizoptDao extends Dao {
return [["updated_at", "DESC"]];
}
extraWhere(qobj, qw, qc) {
// 权限添加
//需要添加公司查询条件
qc.where["facilitator_id"] = Number(qobj.company_id);
// 组织结构
if (qobj.opath && qobj.opath != "") {
qc.where["salesman_opcode"] = { [this.db.Op.like]: `'%${qobj.opath}%'` }
}
qc.raw = true;
qc.where.business_type = qc.where.business_type ? qc.where.business_type : {
$in: [system.SERVICECODE.EDI, system.SERVICECODE.ICP]
......
......@@ -9,6 +9,15 @@ class DeliverDao extends Dao {
return [["updated_at", "DESC"]];
}
extraWhere(qobj, qw, qc) {
// 权限添加
//需要添加公司查询条件
qc.where["facilitator_id"] = Number(qobj.company_id);
// 组织结构
if (qobj.opath && qobj.opath != "") {
qc.where["salesman_opcode"] = { [this.db.Op.like]: `'%${qobj.opath}%'` }
}
qc.raw = true;
let type = qobj.bizpath.split('/')[1];
if (type === 'deliveryManagement') {
......
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