read-from-undefined-err
Showing
1 changed file
with
4 additions
and
2 deletions
@@ -193,11 +193,13 @@ class BackNew { | @@ -193,11 +193,13 @@ class BackNew { | ||
193 | let backCount = _.get(req.session, 'backupCaptch.count'); // 短信验证码 发送次数 | 193 | let backCount = _.get(req.session, 'backupCaptch.count'); // 短信验证码 发送次数 |
194 | 194 | ||
195 | if (!backCount) { | 195 | if (!backCount) { |
196 | + let timeout = _.parseInt(_.get(req, 'session.backupCaptch.timeout')); | ||
197 | + | ||
196 | /* 如果设置了冻结时间,验证 */ | 198 | /* 如果设置了冻结时间,验证 */ |
197 | - let untilTime = (parseInt(req.session.backupCaptch.timeout, 10) - | 199 | + let untilTime = (timeout - |
198 | parseInt(Date.now(), 10)) / 1000 / 60; | 200 | parseInt(Date.now(), 10)) / 1000 / 60; |
199 | 201 | ||
200 | - if (parseInt(Date.now(), 10) < parseInt(req.session.backupCaptch.timeout, 10)) { | 202 | + if (parseInt(Date.now(), 10) < timeout) { |
201 | return res.json({ | 203 | return res.json({ |
202 | code: 401, | 204 | code: 401, |
203 | message: '请' + (parseInt(untilTime, 10) + 1) + '分钟后尝试!' | 205 | message: '请' + (parseInt(untilTime, 10) + 1) + '分钟后尝试!' |
-
Please register or login to post a comment