|
|
@@ -253,14 +253,14 @@ public class UserInfoController {
|
|
253
|
253
|
})
|
|
254
|
254
|
public Map<String, Object> Login(HttpServletRequest request, String username, String password, String yzm, String from) {
|
|
255
|
255
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
256
|
|
- /*if (StringUtils.isBlank(from) || from.compareTo("app")!=0) {
|
|
|
256
|
+ if (StringUtils.isBlank(from) || from.compareTo("app")!=0) {
|
|
257
|
257
|
String yzm_code = ObjectUtils.toString(request.getSession().getAttribute("Service_Code"),"");
|
|
258
|
258
|
if (!yzm_code.equals(yzm)) {
|
|
259
|
259
|
map.put("status", false);
|
|
260
|
260
|
map.put("success", "验证码输入错误!");
|
|
261
|
261
|
return map;
|
|
262
|
262
|
}
|
|
263
|
|
- }*/
|
|
|
263
|
+ }
|
|
264
|
264
|
UserInfo userInfo = null;
|
|
265
|
265
|
// 机构名称
|
|
266
|
266
|
String orgName = null;
|
|
|
@@ -299,14 +299,6 @@ public class UserInfoController {
|
|
299
|
299
|
return map;
|
|
300
|
300
|
}*/
|
|
301
|
301
|
|
|
302
|
|
- // 判断是否启用(离职状态)
|
|
303
|
|
- String zgzt = userInfo.getZgzt();
|
|
304
|
|
- if ("02".equals(zgzt)) {
|
|
305
|
|
- map.put("status", false);
|
|
306
|
|
- map.put("success", "该用户名为离职状态!");
|
|
307
|
|
- return map;
|
|
308
|
|
- }
|
|
309
|
|
-
|
|
310
|
302
|
int limitTime = Integer.parseInt(loginTime);
|
|
311
|
303
|
/**************************用户登录失败处理功能,限制用户非法登录次数************************/
|
|
312
|
304
|
if(userInfo == null) {//密码输入错误
|
|
|
@@ -332,6 +324,13 @@ public class UserInfoController {
|
|
332
|
324
|
}
|
|
333
|
325
|
redisUtil.set(username+"_errorCount", String.valueOf(errorCount));
|
|
334
|
326
|
}else {//登录成功
|
|
|
327
|
+ // 判断是否启用(离职状态)
|
|
|
328
|
+ String zgzt = userInfo.getZgzt();
|
|
|
329
|
+ if ("02".equals(zgzt)) {
|
|
|
330
|
+ map.put("status", false);
|
|
|
331
|
+ map.put("success", "该用户为离职状态!");
|
|
|
332
|
+ return map;
|
|
|
333
|
+ }
|
|
335
|
334
|
//获取登录错误次数
|
|
336
|
335
|
String errorCount = ObjectUtils.toString(redisUtil.get(username+"_errorCount"),"0");
|
|
337
|
336
|
if(Integer.parseInt(errorCount) < 5) {//错误次数小于5次,清空错误登录次数
|