Authored by 梁志锋

登录支持验证码

... ... @@ -87,8 +87,6 @@ module.exports = {
return callback(null, result);
};
var loginErrcallback = function (err) {
req.session.captchaErrorTimes +=1 ;
console.log(req.session.captchaErrorTimes);
result.needCaptcha = true;
return callback(null, result);
};
... ... @@ -100,7 +98,6 @@ module.exports = {
if(userData.data_authority&&userData.data_authority.brand&&userData.data_authority.brand.list){
userInfo.brands=userData.data_authority.brand.is_all?"0":Object.keys(userData.data_authority.brand.list);
}
req.session.captchaErrorTimes = 0 ;
common.allRight().sessionAsync(user, password).done(function (allRes,sesRes) {
var cookie = sesRes.caseless.dict["set-cookie"];
allRes.data.forEach(function (data) {
... ...
... ... @@ -20,13 +20,13 @@
</div>
</div>
<div class="login-content">
<form method="POST" class="margin-bottom-0" onsubmit='return false;'>
<form class="margin-bottom-0" onsubmit='return false;'>
<input type="hidden" name="refer" value="%2F">
<div class="form-group m-b-20">
<input type="text" class="form-control input-lg" name="user" placeholder="用户名" autocomplete="off" />
<input type="text" class="form-control input-lg" id="user" name="user" placeholder="用户名" autocomplete="off" />
</div>
<div class="form-group m-b-20">
<input type="password" class="form-control input-lg" name="password" placeholder="密码" autocomplete="off" />
<input type="password" class="form-control input-lg" id="password" name="password" placeholder="密码" autocomplete="off" />
</div>
<div class="input-group mb15 captcha-wrap hide">
<input type="text" name="captcha" id="captcha" class="form-control" placeholder="图形验证码" autocomplete="off" maxlength="4">
... ...