明树Git Lab

Commit 949f8ebf authored by Administrator's avatar Administrator

Merge branch 'dev' into 'master'

userinfo add include

See merge request !3
parents d67a96fc 5eb6d71d
Pipeline #103956 passed with stage
in 3 seconds
......@@ -140,12 +140,24 @@ async function getUserInfo(req, res, next) {
where: query,
// raw: true,
attributes: { exclude: ['password', 'salt'] },
include: [{
model: DB.Role,
as: 'roles',
// where: { del: 0 },
// attributes: ['id']
}]
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