|
@ -9,13 +9,14 @@ class AccountService { |
|
|
return res.dataValues; |
|
|
return res.dataValues; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async getAccountInfo({ id, username, role }) { |
|
|
|
|
|
|
|
|
async getAccountInfo({ id, username, role, name }) { |
|
|
const whereOpt = {}; |
|
|
const whereOpt = {}; |
|
|
id && Object.assign(whereOpt, { id }); |
|
|
id && Object.assign(whereOpt, { id }); |
|
|
username && Object.assign(whereOpt, { username }); |
|
|
username && Object.assign(whereOpt, { username }); |
|
|
role && Object.assign(whereOpt, { role }); |
|
|
role && Object.assign(whereOpt, { role }); |
|
|
|
|
|
name && Object.assign(whereOpt, { name }); |
|
|
const res = await Account.findOne({ |
|
|
const res = await Account.findOne({ |
|
|
attributes: ["id", "username", "role", "name"], |
|
|
|
|
|
|
|
|
attributes: ["id", "username", "role", "name", "password"], |
|
|
where: whereOpt, |
|
|
where: whereOpt, |
|
|
}); |
|
|
}); |
|
|
return res ? res.dataValues : null; |
|
|
return res ? res.dataValues : null; |
|
|