xiongzhu il y a 3 ans
Parent
commit
6be1125ecc

+ 8 - 0
src/main/java/com/izouma/nineth/service/SysConfigService.java

@@ -234,6 +234,14 @@ public class SysConfigService {
                     .value("0")
                     .build());
         }
+        if (list.stream().noneMatch(i -> i.getName().equals("enable_face_auth"))) {
+            sysConfigRepo.save(SysConfig.builder()
+                    .name("enable_face_auth")
+                    .desc("使用支付宝人脸实名认证")
+                    .type(SysConfig.ValueType.BOOLEAN)
+                    .value("0")
+                    .build());
+        }
         SearchMode searchMode = SearchMode.valueOf(sysConfigRepo.findByName("default_search_mode").get().getValue());
         JpaUtils.setDefaultSearchMode(searchMode);
 

+ 3 - 2
src/main/java/com/izouma/nineth/service/UserService.java

@@ -1068,8 +1068,9 @@ public class UserService {
                 request.setBizContent(biz.toJSONString());
                 AlipayUserCertifyOpenQueryResponse response = alipayClient.execute(request);
                 if (response.isSuccess()) {
-                    JSONObject jsonObject = JSONObject.parseObject(response.getBody());
-                    if (StringUtils.equals(jsonObject.getString("passed"), "T")) {
+                    JSONObject res = JSONObject.parseObject(response.getBody());
+                    JSONObject data = res.getJSONObject("alipay_user_certify_open_query_response");
+                    if (StringUtils.equals(data.getString("passed"), "T")) {
                         User user = userRepo.findById(faceAuth.getUserId()).orElse(null);
                         if (user != null) {
                             IdentityAuth identityAuth = identityAuthRepo.save(IdentityAuth.builder()