Authored by 郭成尧

is-skip

... ... @@ -35,6 +35,9 @@ passport.use(new LocalStrategy({
let area = req.body.areaCode || '86';
let clientIp = req.yoho.clientIp || '';
let isSkip = req.body.isskip;
console.log('loginPost:', req.session.passwordWeakIgnore);
if (isNaN(parseInt(area, 0)) || _.isEmpty(username) || _.isEmpty(password)) {
logger.info(`【Passport Loginbad params, area:${area} account:${username} password:${password}`);
... ... @@ -65,7 +68,7 @@ passport.use(new LocalStrategy({
let shoppingKey = cookie.getShoppingKey(req);
AuthHelper.signinAes(area, username, password, shoppingKey, clientIp).then((result) => {
AuthHelper.signinAes(area, username, password, shoppingKey, clientIp, isSkip).then((result) => {
if (result.code && result.code === 200 && result.data.uid) {
done(null, result.data);
} else if (result.code && result.code === 4189) {
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-04-13 10:21:07
* @Last Modified by: Targaryen
* @Last Modified time: 2017-04-14 16:49:51
* @Last Modified time: 2017-04-14 17:51:10
*/
/* ********************
... ... @@ -16,7 +16,6 @@ const reset = require('../models/reset');
const passwordResetPage = (req, res) => {
let passwordWeakObj = req.session.passwordWeak;
console.log(passwordWeakObj);
res.render('reset/password', {
width750: true,
module: 'passport',
... ...
... ... @@ -24,12 +24,13 @@ class Auth {
return api.post('', param);
}
static signinAes(area, profile, password, shoppingKey, ip) {
static signinAes(area, profile, password, shoppingKey, ip, isSkip) {
let param = {
method: 'app.passport.signinAES',
area: area,
profile: profile,
password: aes.aesPwd(password)
password: aes.aesPwd(password),
isSkip: isSkip ? isSkip : 'N'
};
if (shoppingKey) {
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-04-13 10:25:56
* @Last Modified by: Targaryen
* @Last Modified time: 2017-04-14 13:48:19
* @Last Modified time: 2017-04-14 17:07:09
*/
/* ******************
... ... @@ -12,6 +12,7 @@
'use strict';
const api = global.yoho.API;
const aes = require('./aes-pwd');
/**
* 重置密码
... ... @@ -21,8 +22,8 @@ const resetPassword = (params) => {
return api.post('', {
method: 'app.password.modPwdByCode',
uid: params.uid,
oldPwd: params.oldPwd,
newPwd: params.newPwd,
oldPwd: aes.aesPwd(params.oldPwd),
newPwd: aes.aesPwd(params.newPwd),
token: params.token
});
};
... ...
... ... @@ -169,7 +169,8 @@ $loginBtn.on('touchstart', function() {
if ((/^[0-9]+$/.test(acc) || api.emailRegx.test(acc)) && api.pwdValidate(pwd)) {
let params = {
account: acc,
password: pwd
password: pwd,
isskip: window.queryString.isskip
};
if ($captcha.data('userverify')) {
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-04-13 14:43:19
* @Last Modified by: Targaryen
* @Last Modified time: 2017-04-14 16:57:16
* @Last Modified time: 2017-04-14 17:53:47
*/
/* ***************
... ... @@ -21,6 +21,7 @@ let $oldPasswordInput = $('#oldPassword');
let $newPasswordInput = $('#newPassword');
let $eye = $resetForm.find('.eye');
let $sureResetBtn = $('#sureResetBtn');
let $ignoreBtn = $('#ignoreBtn');
/**
* 密码显示隐藏
... ... @@ -72,3 +73,10 @@ $sureResetBtn.on('click', function() {
}
});
});
/**
* 跳过弱密码校验
*/
$ignoreBtn.on('click', function() {
location.href = '/passport/login?isskip=Y';
});
... ...