明树Git Lab

Commit 8d69e517 authored by zengfanpei's avatar zengfanpei

update

parent 13f4e8c1
......@@ -180,6 +180,7 @@ async function changePassword(req, res, next) {
let newPassword = req.body.newPassword;
let oldPassword = req.body.oldPassword;
let dbUser = await userModule.findOne({_id: user._id});
console.log(dbUser)
if(!(dbUser && dbUser._id)) {
return res.sendError(errorMessage.loginError);
}
......
......@@ -26,7 +26,7 @@ async function findList(search, fields, options) {
return DB.User.find(search).skip(options.skip).limit(options.limit).select(fields.join(" ")).populate({ path: "roles depart avatar" });
}
async function findOne(search, fields) {
async function findOne(search, fields = []) {
const user = await DB.User.findOne(search).select(fields.join(" "));
return user;
}
......
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