fix: sign 模块里的await

This commit is contained in:
chaosBreaking
2019-09-08 00:22:43 +08:00
parent e861252812
commit b5745e3f7f

View File

@@ -208,7 +208,7 @@ module.exports = {
return async (req, res) => {
const { userId } = res.locals.user;
const { password, newPassword } = req.body;
const user = User.findById(userId);
const user = await User.findById(userId).exec();
if (!user || user.password !== Crypto.hash(password, { salt: PWD_HASH_SALT }))
return res.json({
code: 1,