...
|
...
|
@@ -10,6 +10,9 @@ package com.agent.controller.system; |
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
|
import com.framework.util.PropertiesLoader;
|
|
|
import com.framework.util.StringUtils;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.apache.shiro.authc.IncorrectCredentialsException;
|
|
|
import org.apache.shiro.authc.LockedAccountException;
|
...
|
...
|
@@ -18,6 +21,7 @@ import org.apache.shiro.authc.UsernamePasswordToken; |
|
|
import org.apache.shiro.subject.Subject;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
...
|
...
|
@@ -39,6 +43,8 @@ import com.framework.util.MD5Tools; |
|
|
import login.FLogin;
|
|
|
import login.LoginData;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Controller
|
|
|
public class LoginController {
|
|
|
|
...
|
...
|
@@ -144,13 +150,14 @@ public class LoginController { |
|
|
@RequestMapping(value = "/doLogin", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
public ResponseModel doLogin(String loginAccount, String password, String captcha) {
|
|
|
|
|
|
SessionUtil.putKey(Constants.CAPTCHA, "");
|
|
|
ResponseModel rm = new ResponseModel(200, "", null);
|
|
|
|
|
|
UserEntity user = new UserEntity();
|
|
|
user.setLoginaccount(loginAccount);
|
|
|
user.setPassword(password);
|
|
|
if (!loginAccount.equals("admin")) {
|
|
|
if (!loginAccount.equals("admin") && loginAccount.equals(PropertiesLoader.getLogin("openRemoteLogin"))) {
|
|
|
// 远程登录
|
|
|
// 用户数据
|
|
|
LoginData login = FLogin.login(user);
|
...
|
...
|
@@ -224,20 +231,21 @@ public class LoginController { |
|
|
rm.setStatus(500);
|
|
|
rm.setMsg("1");
|
|
|
} catch (IncorrectCredentialsException e) {
|
|
|
rm.setStatus(500);
|
|
|
rm.setMsg("1");
|
|
|
} catch (LockedAccountException e) {
|
|
|
rm.setStatus(500);
|
|
|
rm.setMsg("1");
|
|
|
}
|
|
|
rm.setStatus(500);
|
|
|
rm.setMsg("1");
|
|
|
} catch (LockedAccountException e) {
|
|
|
rm.setStatus(500);
|
|
|
rm.setMsg("1");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return rm;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 登录操作api
|
|
|
*
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/loginApi", method = RequestMethod.POST)
|
...
|
...
|
|