From 762e54c2cf08e32e1bf70b0770987dc7c266025a Mon Sep 17 00:00:00 2001 From: chaosBreaking Date: Sat, 7 Sep 2019 10:46:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=93=88=E5=B8=8Csalt=E4=BC=A0=E5=8F=82?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/sign/sign.controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/sign/sign.controller.js b/src/modules/sign/sign.controller.js index 38d25a1..b71e5ba 100644 --- a/src/modules/sign/sign.controller.js +++ b/src/modules/sign/sign.controller.js @@ -179,7 +179,7 @@ module.exports = { msg: 'Incorrect code' }); } - const newPasswd = Crypto.hash(password, PWD_HASH_SALT); + const newPasswd = Crypto.hash(password, { salt: PWD_HASH_SALT }); const query = { phone }; const update = { password: newPasswd }; // eslint-disable-next-line no-unused-vars @@ -208,7 +208,7 @@ module.exports = { code: 1, msg: '原始密码错误' }); - const newHashPasswd = Crypto.hash(newPassword, PWD_HASH_SALT); + const newHashPasswd = Crypto.hash(newPassword, { salt: PWD_HASH_SALT }); const update = { password: newHashPasswd }; const success = await User.findByIdAndUpdate(userId, update, { new: true }) // eslint-disable-next-line no-unused-vars