From b5745e3f7fab63392d0d11a8de40852837dbcec4 Mon Sep 17 00:00:00 2001 From: chaosBreaking Date: Sun, 8 Sep 2019 00:22:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20sign=20=E6=A8=A1=E5=9D=97=E9=87=8C?= =?UTF-8?q?=E7=9A=84await?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/sign/sign.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/sign/sign.controller.js b/src/modules/sign/sign.controller.js index fe78668..4612695 100644 --- a/src/modules/sign/sign.controller.js +++ b/src/modules/sign/sign.controller.js @@ -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,