From 0638a4cc5bfb5e43cb42e5c4d0c886f412c15f45 Mon Sep 17 00:00:00 2001 From: chaosBreaking Date: Mon, 30 Sep 2019 10:53:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=89=8D=E7=AB=AF=E8=A1=A5=E4=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/fund/fund.controller.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/fund/fund.controller.js b/src/modules/fund/fund.controller.js index d4781fa..0ab3c24 100644 --- a/src/modules/fund/fund.controller.js +++ b/src/modules/fund/fund.controller.js @@ -124,7 +124,11 @@ module.exports = { error: '不满足提现条件', }); } - if (user.fundPwd !== Crypto.hash(password)) return res.json({ + let hashpwd = password; + if (hashpwd.length < 30) { + hashpwd = Crypto.hash(password, {hasher: 'md5'}); + } + if (user.fundPwd !== Crypto.hash(hashpwd)) return res.json({ code: 1, msg: '资金密码错误', error: '资金密码错误',