|
|
@ -11,7 +11,7 @@ async function getUser (ctx, next) { |
|
|
|
departmentId: parseInt(depId), |
|
|
|
delete: false |
|
|
|
}, |
|
|
|
attributes: { exclude: ['password', 'delete'] }, |
|
|
|
attributes: { exclude: ['password', 'delete', 'username'] }, |
|
|
|
order: [['id', 'asc']], |
|
|
|
}) |
|
|
|
|
|
|
@ -33,7 +33,7 @@ async function getUserAll (ctx, next) { |
|
|
|
where: { |
|
|
|
delete: false |
|
|
|
}, |
|
|
|
attributes: { exclude: ['password', 'delete'] }, |
|
|
|
attributes: { exclude: ['password', 'delete', 'username'] }, |
|
|
|
order: [['id', 'asc']], |
|
|
|
}) |
|
|
|
|
|
|
@ -55,7 +55,7 @@ async function creatUser (ctx, next) { |
|
|
|
|
|
|
|
let repeatUserNameCount = await models.User.count({ |
|
|
|
where: { |
|
|
|
username: data.username, |
|
|
|
phone: data.phone, |
|
|
|
delete: false |
|
|
|
} |
|
|
|
}) |
|
|
@ -66,7 +66,7 @@ async function creatUser (ctx, next) { |
|
|
|
|
|
|
|
await models.User.create({ |
|
|
|
name: data.name, |
|
|
|
username: data.username, |
|
|
|
// username: data.username,
|
|
|
|
password: Hex.stringify(MD5(data.password)), |
|
|
|
departmentId: data.departmentId, |
|
|
|
email: data.email, |
|
|
@ -96,7 +96,7 @@ async function updateUser (ctx, next) { |
|
|
|
|
|
|
|
let repeatUserNameCount = await models.User.count({ |
|
|
|
where: { |
|
|
|
username: data.username, |
|
|
|
phone: data.phone, |
|
|
|
delete: false, |
|
|
|
id: { $ne: userId } |
|
|
|
} |
|
|
@ -108,7 +108,7 @@ async function updateUser (ctx, next) { |
|
|
|
|
|
|
|
await models.User.update({ |
|
|
|
name: data.name, |
|
|
|
username: data.username, |
|
|
|
// username: data.username,
|
|
|
|
departmentId: data.departmentId, |
|
|
|
email: data.email, |
|
|
|
enable: data.enable, |
|
|
|