|
|
@ -42,11 +42,15 @@ public class IndexController {
|
|
|
|
@RequestMapping(value="login", method=RequestMethod.POST)
|
|
|
|
@RequestMapping(value="login", method=RequestMethod.POST)
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
@PermessionLimit(limit=false)
|
|
|
|
@PermessionLimit(limit=false)
|
|
|
|
public ReturnT<String> loginDo(HttpServletRequest request, HttpServletResponse response, String userName, String password){
|
|
|
|
public ReturnT<String> loginDo(HttpServletRequest request, HttpServletResponse response, String userName, String password, String ifRemember){
|
|
|
|
if (!PermissionInterceptor.ifLogin(request)) {
|
|
|
|
if (!PermissionInterceptor.ifLogin(request)) {
|
|
|
|
if (StringUtils.isNotBlank(userName) && StringUtils.isNotBlank(password)
|
|
|
|
if (StringUtils.isNotBlank(userName) && StringUtils.isNotBlank(password)
|
|
|
|
&& "admin".equals(userName) && "123456".equals(password)) {
|
|
|
|
&& "admin".equals(userName) && "123456".equals(password)) {
|
|
|
|
PermissionInterceptor.login(response);
|
|
|
|
boolean ifRem = false;
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(ifRemember) && "on".equals(ifRemember)) {
|
|
|
|
|
|
|
|
ifRem = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
PermissionInterceptor.login(response, ifRem);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return new ReturnT<String>(500, "账号或密码错误");
|
|
|
|
return new ReturnT<String>(500, "账号或密码错误");
|
|
|
|
}
|
|
|
|
}
|
|
|
|