소스 검색

去掉人脸活体检测

qzy 7 달 전
부모
커밋
ae7048b7d6

+ 1 - 1
sp-service/level-two-server/src/main/java/com/pj/tb_orders/TbOrdersController.java

@@ -110,7 +110,7 @@ public class TbOrdersController {
         boolean b =  FeignFactory.levelOneServerInterface.updateResaleStatus(so.getLong("id"));
         if (!b) throw new RuntimeException("修改一级市场边民订单转售状态为已转售失败!");
 
-        return AjaxJson.toAjax(tbOrdersService.addOrderByResale(so));
+        return AjaxJson.getSuccess();
     }
 
     /**

+ 18 - 4
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserService.java

@@ -294,7 +294,7 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
         //获取登录用户
         AppUser appUser = userList.get(0);
         if (appUser.getFace() == 1) {
-           // return AjaxJson.getError("该账号只支持人脸登录");
+            // return AjaxJson.getError("该账号只支持人脸登录");
         }
         //比对密码
         String userPassword = appUser.getPassword();
@@ -643,7 +643,7 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
             boolean isLive = faceFactory.handler().checkIsLive(img);
             if (!isLive) {
                 log.error("人脸注册为非活体人脸:{}", loginId);
-                throw new AjaxError("非活体人脸");
+                // throw new AjaxError("非活体人脸");
             }
         } catch (IOException e) {
             throw new AjaxError("识别失败");
@@ -656,6 +656,20 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
         faceFactory.handler().createPersonByBase(faceId, appUser.getName(), img);
     }
 
+    public void authFace(Long loginId, String img) {
+        boolean isLive = faceFactory.handler().checkIsLive(img);
+        if (!isLive) {
+            log.error("人脸注册为非活体人脸:{}", loginId);
+            // throw new AjaxError("非活体人脸");
+        }
+        String faceId = RandomUtil.randomString(32);
+        AppUser appUser = this.getById(loginId);
+        appUser.setFace(1);
+        appUser.setFaceTime(new Date()).setFaceId(faceId);
+        this.updateById(appUser);
+        faceFactory.handler().createPersonByBase(faceId, appUser.getName(), img);
+    }
+
     public AjaxJson faceLogin(MultipartFile file) {
         String img;
         try (InputStream is = file.getInputStream()) {
@@ -734,8 +748,8 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
 
     public void changeBindShopStatus(BindShopDTO bindShopDTO) {
         log.info("修改绑定状态:{}", JSONUtil.toJsonStr(bindShopDTO));
-        StrUtil.split(bindShopDTO.getIds(),",").forEach(id->{
-            appUserMapper.changeBindShopStatus(id,bindShopDTO.getBindShop());
+        StrUtil.split(bindShopDTO.getIds(), ",").forEach(id -> {
+            appUserMapper.changeBindShopStatus(id, bindShopDTO.getBindShop());
         });
     }
 }

+ 9 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user/vo/FaceAuthVO.java

@@ -0,0 +1,9 @@
+package com.pj.project.app_user.vo;
+
+import lombok.Data;
+
+@Data
+public class FaceAuthVO {
+    private String id;
+    private String img;
+}