| | |
| | | }else{ |
| | | for (UserInf temp:userInfList){ |
| | | String filePath = temp.getFace().getUrl(); |
| | | ImageInfo imageInfo2 = ImageFactory.getRGBData(new File(filePath)); |
| | | Response res3 = FaceIdentifyUtil.faceCompare(faceEngine, imageInfo, imageInfo2); |
| | | File file = new File(filePath); |
| | | //不存在则不继续执行 |
| | | if(!file.exists()){ |
| | | continue; |
| | | } |
| | | ImageInfo imageInfo2 = ImageFactory.getRGBData(file); |
| | | res = FaceIdentifyUtil.faceCompare(faceEngine, imageInfo, imageInfo2); |
| | | //对比成功,记录用户登录信息 |
| | | if(res3.getCode()==1){ |
| | | if(res.getCode()==1){ |
| | | //Ukey对应用户和人脸对应用户验证 |
| | | if(!temp.getUId().equals(userByUKeyId.getUId())){ |
| | | return res.set(1,false,"UKey对应用户和当前人脸对应用户不匹配"); |
| | | } |
| | | |
| | | res.setData2(temp); |
| | | |
| | | // 将登陆成功的用户存入session |
| | | ActionUtil.getSession().setAttribute("user", temp); |
| | | |
| | |
| | | if (permitList!=null && permitList.size()!=0) { |
| | | ActionUtil.getSession().setAttribute("permits", permitList); |
| | | } else { |
| | | res.setCode(0); |
| | | res.setCode(1); |
| | | res.setData(false); |
| | | res.setMsg("还未分配权限"); |
| | | } |
| | | //将新登录的用户存入application |