明树Git Lab

Commit 5eb6d71d authored by zhangqi's avatar zhangqi

userinfo add include

parent eb45c129
......@@ -140,12 +140,24 @@ async function getUserInfo(req, res, next) {
where: query,
// raw: true,
attributes: { exclude: ['password', 'salt'] },
include: [{
include: [
{
model: DB.Role,
as: 'roles',
// where: { del: 0 },
// attributes: ['id']
}]
},{
model: DB.Depart,
as: 'departs',
// attributes: ["id"],
// through: { attributes: [] },
}, {
model: DB.Position,
as: 'positions',
// attributes: ["id"],
// through: { attributes: [] },
}
]
});
return res.sendData(ret);
} catch (error) {
......
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