Commit 87649777 authored by 吴卿华's avatar 吴卿华

app 记住密码登录

parent cc3d41c6
......@@ -56,7 +56,7 @@ public class SysLoginController
AjaxResult ajax = AjaxResult.success();
// 生成令牌
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
loginBody.getUuid());
loginBody.getUuid(),loginBody.getRememberPsw());
ajax.put(Constants.TOKEN, token);
return ajax;
}
......
......@@ -27,6 +27,20 @@ public class LoginBody
*/
private String uuid = "";
/**
* 手机端 记住密码登录 验证是否通过验证码
* @return
*/
private int rememberPsw;
public int getRememberPsw() {
return rememberPsw;
}
public void setRememberPsw(int rememberPsw) {
this.rememberPsw = rememberPsw;
}
public String getUsername()
{
return username;
......
......@@ -52,7 +52,7 @@ public class SysLoginService
* @param uuid 唯一标识
* @return 结果
*/
public String login(String username, String password, String code, String uuid)
public String login(String username, String password, String code, String uuid,int rememberPsw)
{
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
String captcha = redisCache.getCacheObject(verifyKey);
......@@ -62,11 +62,12 @@ public class SysLoginService
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
throw new CaptchaExpireException();
}
if (!code.equalsIgnoreCase(captcha))
{
if (rememberPsw!=1) {
if (!code.equalsIgnoreCase(captcha)) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
throw new CaptchaException();
}
}
// 用户验证
Authentication authentication = null;
try
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment