Showing
6 changed files
with
23 additions
and
10 deletions
@@ -35,6 +35,9 @@ passport.use(new LocalStrategy({ | @@ -35,6 +35,9 @@ passport.use(new LocalStrategy({ | ||
35 | 35 | ||
36 | let area = req.body.areaCode || '86'; | 36 | let area = req.body.areaCode || '86'; |
37 | let clientIp = req.yoho.clientIp || ''; | 37 | let clientIp = req.yoho.clientIp || ''; |
38 | + let isSkip = req.body.isskip; | ||
39 | + | ||
40 | + console.log('loginPost:', req.session.passwordWeakIgnore); | ||
38 | 41 | ||
39 | if (isNaN(parseInt(area, 0)) || _.isEmpty(username) || _.isEmpty(password)) { | 42 | if (isNaN(parseInt(area, 0)) || _.isEmpty(username) || _.isEmpty(password)) { |
40 | logger.info(`【Passport Login】bad params, area:${area} account:${username} password:${password}`); | 43 | logger.info(`【Passport Login】bad params, area:${area} account:${username} password:${password}`); |
@@ -65,7 +68,7 @@ passport.use(new LocalStrategy({ | @@ -65,7 +68,7 @@ passport.use(new LocalStrategy({ | ||
65 | 68 | ||
66 | let shoppingKey = cookie.getShoppingKey(req); | 69 | let shoppingKey = cookie.getShoppingKey(req); |
67 | 70 | ||
68 | - AuthHelper.signinAes(area, username, password, shoppingKey, clientIp).then((result) => { | 71 | + AuthHelper.signinAes(area, username, password, shoppingKey, clientIp, isSkip).then((result) => { |
69 | if (result.code && result.code === 200 && result.data.uid) { | 72 | if (result.code && result.code === 200 && result.data.uid) { |
70 | done(null, result.data); | 73 | done(null, result.data); |
71 | } else if (result.code && result.code === 4189) { | 74 | } else if (result.code && result.code === 4189) { |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | * @Author: Targaryen | 2 | * @Author: Targaryen |
3 | * @Date: 2017-04-13 10:21:07 | 3 | * @Date: 2017-04-13 10:21:07 |
4 | * @Last Modified by: Targaryen | 4 | * @Last Modified by: Targaryen |
5 | - * @Last Modified time: 2017-04-14 16:49:51 | 5 | + * @Last Modified time: 2017-04-14 17:51:10 |
6 | */ | 6 | */ |
7 | 7 | ||
8 | /* ******************** | 8 | /* ******************** |
@@ -16,7 +16,6 @@ const reset = require('../models/reset'); | @@ -16,7 +16,6 @@ const reset = require('../models/reset'); | ||
16 | const passwordResetPage = (req, res) => { | 16 | const passwordResetPage = (req, res) => { |
17 | let passwordWeakObj = req.session.passwordWeak; | 17 | let passwordWeakObj = req.session.passwordWeak; |
18 | 18 | ||
19 | - console.log(passwordWeakObj); | ||
20 | res.render('reset/password', { | 19 | res.render('reset/password', { |
21 | width750: true, | 20 | width750: true, |
22 | module: 'passport', | 21 | module: 'passport', |
@@ -24,12 +24,13 @@ class Auth { | @@ -24,12 +24,13 @@ class Auth { | ||
24 | return api.post('', param); | 24 | return api.post('', param); |
25 | } | 25 | } |
26 | 26 | ||
27 | - static signinAes(area, profile, password, shoppingKey, ip) { | 27 | + static signinAes(area, profile, password, shoppingKey, ip, isSkip) { |
28 | let param = { | 28 | let param = { |
29 | method: 'app.passport.signinAES', | 29 | method: 'app.passport.signinAES', |
30 | area: area, | 30 | area: area, |
31 | profile: profile, | 31 | profile: profile, |
32 | - password: aes.aesPwd(password) | 32 | + password: aes.aesPwd(password), |
33 | + isSkip: isSkip ? isSkip : 'N' | ||
33 | }; | 34 | }; |
34 | 35 | ||
35 | if (shoppingKey) { | 36 | if (shoppingKey) { |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | * @Author: Targaryen | 2 | * @Author: Targaryen |
3 | * @Date: 2017-04-13 10:25:56 | 3 | * @Date: 2017-04-13 10:25:56 |
4 | * @Last Modified by: Targaryen | 4 | * @Last Modified by: Targaryen |
5 | - * @Last Modified time: 2017-04-14 13:48:19 | 5 | + * @Last Modified time: 2017-04-14 17:07:09 |
6 | */ | 6 | */ |
7 | 7 | ||
8 | /* ****************** | 8 | /* ****************** |
@@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
12 | 'use strict'; | 12 | 'use strict'; |
13 | 13 | ||
14 | const api = global.yoho.API; | 14 | const api = global.yoho.API; |
15 | +const aes = require('./aes-pwd'); | ||
15 | 16 | ||
16 | /** | 17 | /** |
17 | * 重置密码 | 18 | * 重置密码 |
@@ -21,8 +22,8 @@ const resetPassword = (params) => { | @@ -21,8 +22,8 @@ const resetPassword = (params) => { | ||
21 | return api.post('', { | 22 | return api.post('', { |
22 | method: 'app.password.modPwdByCode', | 23 | method: 'app.password.modPwdByCode', |
23 | uid: params.uid, | 24 | uid: params.uid, |
24 | - oldPwd: params.oldPwd, | ||
25 | - newPwd: params.newPwd, | 25 | + oldPwd: aes.aesPwd(params.oldPwd), |
26 | + newPwd: aes.aesPwd(params.newPwd), | ||
26 | token: params.token | 27 | token: params.token |
27 | }); | 28 | }); |
28 | }; | 29 | }; |
@@ -169,7 +169,8 @@ $loginBtn.on('touchstart', function() { | @@ -169,7 +169,8 @@ $loginBtn.on('touchstart', function() { | ||
169 | if ((/^[0-9]+$/.test(acc) || api.emailRegx.test(acc)) && api.pwdValidate(pwd)) { | 169 | if ((/^[0-9]+$/.test(acc) || api.emailRegx.test(acc)) && api.pwdValidate(pwd)) { |
170 | let params = { | 170 | let params = { |
171 | account: acc, | 171 | account: acc, |
172 | - password: pwd | 172 | + password: pwd, |
173 | + isskip: window.queryString.isskip | ||
173 | }; | 174 | }; |
174 | 175 | ||
175 | if ($captcha.data('userverify')) { | 176 | if ($captcha.data('userverify')) { |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | * @Author: Targaryen | 2 | * @Author: Targaryen |
3 | * @Date: 2017-04-13 14:43:19 | 3 | * @Date: 2017-04-13 14:43:19 |
4 | * @Last Modified by: Targaryen | 4 | * @Last Modified by: Targaryen |
5 | - * @Last Modified time: 2017-04-14 16:57:16 | 5 | + * @Last Modified time: 2017-04-14 17:53:47 |
6 | */ | 6 | */ |
7 | 7 | ||
8 | /* *************** | 8 | /* *************** |
@@ -21,6 +21,7 @@ let $oldPasswordInput = $('#oldPassword'); | @@ -21,6 +21,7 @@ let $oldPasswordInput = $('#oldPassword'); | ||
21 | let $newPasswordInput = $('#newPassword'); | 21 | let $newPasswordInput = $('#newPassword'); |
22 | let $eye = $resetForm.find('.eye'); | 22 | let $eye = $resetForm.find('.eye'); |
23 | let $sureResetBtn = $('#sureResetBtn'); | 23 | let $sureResetBtn = $('#sureResetBtn'); |
24 | +let $ignoreBtn = $('#ignoreBtn'); | ||
24 | 25 | ||
25 | /** | 26 | /** |
26 | * 密码显示隐藏 | 27 | * 密码显示隐藏 |
@@ -72,3 +73,10 @@ $sureResetBtn.on('click', function() { | @@ -72,3 +73,10 @@ $sureResetBtn.on('click', function() { | ||
72 | } | 73 | } |
73 | }); | 74 | }); |
74 | }); | 75 | }); |
76 | + | ||
77 | +/** | ||
78 | + * 跳过弱密码校验 | ||
79 | + */ | ||
80 | +$ignoreBtn.on('click', function() { | ||
81 | + location.href = '/passport/login?isskip=Y'; | ||
82 | +}); |
-
Please register or login to post a comment