fix: sign 模块里的await
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user