明树Git Lab

Commit dc52e81e authored by zfp1's avatar zfp1

update

parent 5099d9db
Pipeline #103929 passed with stage
in 3 seconds
...@@ -113,8 +113,10 @@ async function createUser(req, res, next) { ...@@ -113,8 +113,10 @@ async function createUser(req, res, next) {
body.roles = body.roles || []; body.roles = body.roles || [];
let userDeparts = body.departs.map(o => { return { userId: ret.id, departId: o && o.id || o } }); let userDeparts = body.departs.map(o => { return { userId: ret.id, departId: o && o.id || o } });
let userRoles = body.roles.map(o => { return { userId: ret.id, roleId: o && o.id || o } }); let userRoles = body.roles.map(o => { return { userId: ret.id, roleId: o && o.id || o } });
let userPositions = body.positionss.map(o => { return { userId: ret.id, roleId: o && o.id || o } });
await DB.UserDepart.bulkCreate(userDeparts); await DB.UserDepart.bulkCreate(userDeparts);
await DB.UserRole.bulkCreate(userRoles); await DB.UserRole.bulkCreate(userRoles);
await DB.UserPosition.bulkCreate(userPositions);
return res.sendData(ret); return res.sendData(ret);
} catch (error) { } catch (error) {
next(error); next(error);
...@@ -138,7 +140,7 @@ async function getUserInfo(req, res, next) { ...@@ -138,7 +140,7 @@ async function getUserInfo(req, res, next) {
include: [{ include: [{
model: DB.Role, model: DB.Role,
as: 'roles', as: 'roles',
where: { del: 0 }, // where: { del: 0 },
// attributes: ['id'] // attributes: ['id']
}] }]
}); });
......
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