错误纠正
This commit is contained in:
parent
0bb9a8b829
commit
cecd62f1ba
@ -674,7 +674,33 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getUserByAccount(Map<String, Object> map) {
|
||||
return null;
|
||||
try {
|
||||
String account = MapUtils.getString(map, "u");
|
||||
Long time = MapUtils.getLong(map, "t");
|
||||
String password = MapUtils.getString(map, "p");
|
||||
String code = "szszhxmgl";
|
||||
String password1 = SecureUtil.md5(account + time + code);
|
||||
time = time * 1000L;
|
||||
DateTime date = DateUtil.date(time);
|
||||
long diff = DateUtil.between(date, new Date(), DateUnit.SECOND);
|
||||
/* if (diff > 60) {
|
||||
throw new OpenAlertException("该参数已失效!");
|
||||
}*/
|
||||
if (!password.equals(password1)) {
|
||||
throw new OpenAlertException("参数校验失败!");
|
||||
}
|
||||
QueryWrapper<SystemUser> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.lambda()
|
||||
.eq(SystemUser::getAccount, account);
|
||||
SystemUser systemUser = systemUserMapper.selectOne(queryWrapper);
|
||||
if (systemUser == null) {
|
||||
throw new OpenAlertException(MessageUtil.get("notFindErr"));
|
||||
}
|
||||
return getUserInfo(systemUser);
|
||||
} catch (AuthenticationException e) {
|
||||
log.error("error:", e);
|
||||
throw new CustomException("Invalid username/password supplied", HttpStatus.UNPROCESSABLE_ENTITY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -761,7 +787,8 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
result.put("seeEquipment", 1);
|
||||
} else {
|
||||
boolean see = baseRoles.stream().anyMatch(baseRole -> Objects.equals(baseRole.getSeeEquipment(), "0"));
|
||||
result.put("seeEquipment", see ? 0 : 1); }
|
||||
result.put("seeEquipment", see ? 0 : 1);
|
||||
}
|
||||
} else {
|
||||
result.put("seeEquipment", 0);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user