Explorar el Código

新增边民首次登录需要人脸认证

李书文 hace 1 año
padre
commit
73e80c192a

+ 8 - 3
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUser.java

@@ -123,9 +123,14 @@ public class AppUser extends Model<AppUser> implements Serializable {
 	 */
 	private String password;
 
+	/**
+	 * 边民是否首次使用APP人脸认证(0=未认证,1=已认证);
+	 */
+	private Integer face;
 
-
-	
-
+	/**
+	 * 验证时间
+	 */
+	private Date faceTime;
 
 }

+ 20 - 2
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserApiController.java

@@ -11,6 +11,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
 
 /**
  * app_user -- 移动端账号(只针对app端使用)
@@ -42,10 +46,24 @@ public class AppUserApiController {
         return AjaxJson.getSuccessData(a);
     }
 
-    /** 获取审核状态 */
+    /** 获取认证状态 */
     @RequestMapping("getAuth")
     public AjaxJson getAuth(){
-        return AjaxJson.getSuccessData(appUserService.getById(StpAPPUserUtil.getAPPLoginInfo().getLoginId()).getAuth());
+        AppUser user=appUserService.getById(StpAPPUserUtil.getAPPLoginInfo().getLoginId());
+        Map so=new HashMap();
+        so.put("auth",user.getAuth());
+        so.put("face",user.getFace());
+        return AjaxJson.getSuccessData(so);
+    }
+
+    /** 边民首次使用APP人脸认证 */
+    @PostMapping("face")
+    public AjaxJson face(){
+        AppUser user=new AppUser();
+        user.setId(StpAPPUserUtil.getAPPLoginInfo().getLoginId());
+        user.setFace(1);
+        user.setFaceTime(new Date());
+        return AjaxJson.toAjax(appUserService.updateById(user));
     }