Explorar el Código

Merge branch 'bgy' of SH-Arbitrate/Arbitrate-Backend into dev

bgy hace 2 años
padre
commit
b89a6ea218

+ 14
- 20
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java Ver fichero

@@ -22,12 +22,11 @@ import com.ruoyi.system.service.ISysMenuService;
22 22
 
23 23
 /**
24 24
  * 登录验证
25
- * 
25
+ *
26 26
  * @author ruoyi
27 27
  */
28 28
 @RestController
29
-public class SysLoginController
30
-{
29
+public class SysLoginController {
31 30
     @Autowired
32 31
     private SysLoginService loginService;
33 32
 
@@ -37,40 +36,36 @@ public class SysLoginController
37 36
     @Autowired
38 37
     private SysPermissionService permissionService;
39 38
     @Autowired
40
-    private IdentityAuthenticationService identityAuthenticationService;
39
+    IdentityAuthenticationService identityAuthenticationService;
41 40
 
42 41
     /**
43 42
      * 登录方法
44
-     * 
43
+     *
45 44
      * @param loginBody 登录信息
46 45
      * @return 结果
47 46
      */
48 47
     @PostMapping("/login")
49
-    public AjaxResult login(@RequestBody LoginBody loginBody)
50
-    {
48
+    public AjaxResult login(@RequestBody LoginBody loginBody) {
51 49
         AjaxResult ajax = AjaxResult.success();
52 50
         // 生成令牌
53 51
         String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
54 52
                 loginBody.getUuid());
55 53
         ajax.put(Constants.TOKEN, token);
56
-
57
-//        IdentityAuthentication identityAuthentication = new IdentityAuthentication();
58
-//        identityAuthentication.setUserName(loginBody.getUsername());
59
-//        IdentityAuthentication identityAuthenticationselect = identityAuthenticationService.selectIdentityAuthentication(identityAuthentication);
60
-//        ajax.put("certificationStatusName", identityAuthenticationselect.getCertificationStatusName());
61
-//        ajax.put("certificationStatus", identityAuthenticationselect.getCertificationStatus());
62
-
54
+        //判断该用户是否已经实名认证(certificationStatus1已认证0未认证)
55
+        IdentityAuthentication identityAuthentication=new IdentityAuthentication();
56
+        identityAuthentication.setUserName(loginBody.getUsername());
57
+        String status = identityAuthenticationService.checkIsAuthentication(identityAuthentication);
58
+        ajax.put("certificationStatus", status);
63 59
         return ajax;
64 60
     }
65 61
 
66 62
     /**
67 63
      * 获取用户信息
68
-     * 
64
+     *
69 65
      * @return 用户信息
70 66
      */
71 67
     @GetMapping("getInfo")
72
-    public AjaxResult getInfo()
73
-    {
68
+    public AjaxResult getInfo() {
74 69
         SysUser user = SecurityUtils.getLoginUser().getUser();
75 70
         // 角色集合
76 71
         Set<String> roles = permissionService.getRolePermission(user);
@@ -85,12 +80,11 @@ public class SysLoginController
85 80
 
86 81
     /**
87 82
      * 获取路由信息
88
-     * 
83
+     *
89 84
      * @return 路由信息
90 85
      */
91 86
     @GetMapping("getRouters")
92
-    public AjaxResult getRouters()
93
-    {
87
+    public AjaxResult getRouters() {
94 88
         Long userId = SecurityUtils.getUserId();
95 89
         List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
96 90
         return AjaxResult.success(menuService.buildMenus(menus));

+ 10
- 23
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java Ver fichero

@@ -1,8 +1,8 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate;
2 2
 
3
+import com.alibaba.fastjson.JSONObject;
3 4
 import com.ruoyi.common.core.controller.BaseController;
4 5
 import com.ruoyi.common.core.domain.AjaxResult;
5
-import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
6 6
 import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
7 7
 import com.ruoyi.wisdomarbitrate.service.IdentityAuthenticationService;
8 8
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,40 +14,27 @@ import org.springframework.web.bind.annotation.RestController;
14 14
 
15 15
 @RestController
16 16
 @RequestMapping("/identityAuthentication")
17
-public class IdentityAuthenticationController   extends BaseController {
17
+public class IdentityAuthenticationController extends BaseController {
18 18
     @Autowired
19 19
     private IdentityAuthenticationService identityAuthenticationService;
20 20
 
21 21
     /**
22
-     * 查询身份认证EIDtoken
22
+     * 获取EIDtoken
23 23
      */
24 24
     @PostMapping("/selectIdentityAuthenticaEIDtoken")
25
-    public AjaxResult selectIdentityAuthenticaEIDtoken()
26
-    {
27
-        IdentityAuthentication ientityAuthentication = identityAuthenticationService.selectIdentityAuthenticaEIDtoken();
28
-        return success(ientityAuthentication);
25
+    public AjaxResult selectIdentityAuthenticaEIDtoken() {
26
+        JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthenticaEIDtoken();
27
+        return success(tokenResult);
29 28
     }
30 29
 
31 30
     /**
32
-     * 查询身份认证结果
31
+     * 小程序人脸核身后查询身份认证结果
33 32
      */
34 33
     @PostMapping("/selectIdentityAuthenticaRespon")
35
-    public AjaxResult selectIdentityAuthenticaRespon(@Validated @RequestBody IdentityAuthentication ientityAuthentication)
36
-    {
37
-        String username = this.getUsername();
38
-        Long userId = this.getUserId();
39
-        ientityAuthentication.setUserId(userId);
40
-        ientityAuthentication.setUserName(username);
41
-        IdentityAuthentication ientityAuthenticationRes = identityAuthenticationService.selectIdentityAuthenticaRespon( ientityAuthentication);
42
-        return success(ientityAuthenticationRes);
34
+    public AjaxResult selectIdentityAuthenticaRespon(@Validated @RequestBody IdentityAuthentication ientityAuthentication) {
35
+        AjaxResult checkResult = identityAuthenticationService.selectIdentityAuthenticaRespon(ientityAuthentication);
36
+        return checkResult;
43 37
     }
44 38
 
45 39
 
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53 40
 }

+ 1
- 1
ruoyi-admin/src/main/resources/application.yml Ver fichero

@@ -166,4 +166,4 @@ identityAuthentication:
166 166
   credentialSecretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv
167 167
   credentialSecretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7
168 168
   merchantId: 0NSJ2309281116194321
169
-  privateKeyHexDecodeinfo: MHcCAQEEIEw7MRv3uYlpmU6Fko4GlXSh6Vd38k0cUQZ5zDwvRg+voAoGCCqBHM9VAYItoUQDQgAEUdxIAWhGg4LUXf1GoPdb8XMbGudpexPQCuaaRi9BCnNbpaF1kcwRhhsBKvop9ZmW/nOz4wQ1r/iIEOrc9qCXgQ==
169
+  privateKeyHexDecodeinfo: 4c3b311bf7b98969994e85928e069574a1e95777f24d1c510679cc3c2f460faf

+ 10
- 10
ruoyi-common/pom.xml Ver fichero

@@ -52,19 +52,19 @@
52 52
             <groupId>org.apache.commons</groupId>
53 53
             <artifactId>commons-lang3</artifactId>
54 54
         </dependency>
55
-  
55
+
56 56
         <!-- JSON工具类 -->
57 57
         <dependency>
58 58
             <groupId>com.fasterxml.jackson.core</groupId>
59 59
             <artifactId>jackson-databind</artifactId>
60 60
         </dependency>
61
-        
61
+
62 62
         <!-- 动态数据源 -->
63
-		<dependency>
64
-			<groupId>com.baomidou</groupId>
65
-			<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
66
-			<version>3.5.2</version>
67
-		</dependency>
63
+        <dependency>
64
+            <groupId>com.baomidou</groupId>
65
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
66
+            <version>3.5.2</version>
67
+        </dependency>
68 68
 
69 69
         <!-- 阿里JSON解析器 -->
70 70
         <dependency>
@@ -136,15 +136,15 @@
136 136
         <dependency>
137 137
             <groupId>com.tencentcloudapi</groupId>
138 138
             <artifactId>tencentcloud-sdk-java</artifactId>
139
-            <version>3.1.270</version>
139
+            <version>3.1.876</version>
140 140
         </dependency>
141 141
 
142 142
         <dependency>
143 143
             <groupId>com.tencentcloudapi</groupId>
144 144
             <artifactId>tencentcloud-sdk-java-faceid</artifactId>
145
-            <version>3.1.871</version>
145
+            <version>3.1.875</version>
146 146
         </dependency>
147
-
147
+        <!--用户信息解密-->
148 148
         <dependency>
149 149
             <groupId>cn.hutool</groupId>
150 150
             <artifactId>hutool-all</artifactId>

+ 23
- 4
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java Ver fichero

@@ -1,15 +1,34 @@
1 1
 package com.ruoyi.wisdomarbitrate.service;
2 2
 
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.ruoyi.common.core.domain.AjaxResult;
3 5
 import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
4
-import com.tencentcloudapi.common.exception.TencentCloudSDKException;
5 6
 
6 7
 public interface IdentityAuthenticationService {
7 8
 
8 9
 
9
-    IdentityAuthentication  selectIdentityAuthentication(IdentityAuthentication identityAuthentication);
10
+    IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication);
10 11
 
12
+    /**
13
+     * 检查是否已经认证的用户
14
+     *
15
+     * @param identityAuthentication
16
+     * @return
17
+     */
18
+    String checkIsAuthentication(IdentityAuthentication identityAuthentication);
11 19
 
12
-    IdentityAuthentication selectIdentityAuthenticaEIDtoken();
20
+    /**
21
+     * 获取Eidtoken
22
+     *
23
+     * @return
24
+     */
25
+    JSONObject selectIdentityAuthenticaEIDtoken();
13 26
 
14
-    IdentityAuthentication selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication);
27
+    /**
28
+     * 小程序人脸核身后查询身份认证结果
29
+     *
30
+     * @param ientityAuthentication
31
+     * @return
32
+     */
33
+    AjaxResult selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication);
15 34
 }

+ 151
- 85
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java Ver fichero

@@ -1,27 +1,27 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.impl;
2 2
 
3 3
 
4
-
4
+import cn.hutool.core.codec.Base64;
5 5
 import cn.hutool.crypto.SmUtil;
6 6
 import cn.hutool.crypto.asymmetric.SM2;
7 7
 import cn.hutool.crypto.symmetric.SymmetricCrypto;
8 8
 import com.alibaba.fastjson.JSON;
9 9
 import com.alibaba.fastjson.JSONObject;
10 10
 import com.ruoyi.common.core.domain.AjaxResult;
11
-import com.ruoyi.common.utils.StringUtils;
12
-import com.ruoyi.exceptions.TradeException;
11
+import com.ruoyi.common.core.domain.model.LoginUser;
12
+import com.ruoyi.common.utils.SecurityUtils;
13 13
 import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
14 14
 import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper;
15
-import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
16 15
 import com.ruoyi.wisdomarbitrate.service.IdentityAuthenticationService;
17
-
18 16
 import com.tencentcloudapi.common.Credential;
17
+import com.tencentcloudapi.common.exception.TencentCloudSDKException;
19 18
 import com.tencentcloudapi.common.profile.ClientProfile;
20 19
 import com.tencentcloudapi.common.profile.HttpProfile;
21
-import com.tencentcloudapi.common.exception.TencentCloudSDKException;
22 20
 import com.tencentcloudapi.faceid.v20180301.FaceidClient;
23
-import com.tencentcloudapi.faceid.v20180301.models.*;
24
-
21
+import com.tencentcloudapi.faceid.v20180301.models.GetEidResultRequest;
22
+import com.tencentcloudapi.faceid.v20180301.models.GetEidResultResponse;
23
+import com.tencentcloudapi.faceid.v20180301.models.GetEidTokenRequest;
24
+import com.tencentcloudapi.faceid.v20180301.models.GetEidTokenResponse;
25 25
 import org.slf4j.Logger;
26 26
 import org.slf4j.LoggerFactory;
27 27
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,15 +29,10 @@ import org.springframework.beans.factory.annotation.Value;
29 29
 import org.springframework.stereotype.Service;
30 30
 import org.springframework.transaction.annotation.Transactional;
31 31
 
32
-import java.io.FileInputStream;
33
-import java.io.IOException;
34
-import java.io.InputStream;
35
-import java.util.Base64;
36
-import java.util.HashMap;
37
-import java.util.Map;
32
+import java.util.Date;
38 33
 
39 34
 @Service
40
-public class IdentityAuthenticationServiceImpl  implements IdentityAuthenticationService {
35
+public class IdentityAuthenticationServiceImpl implements IdentityAuthenticationService {
41 36
 
42 37
     @Value("${identityAuthentication.credentialSecretId}")
43 38
     private String credentialSecretId;
@@ -58,9 +53,9 @@ public class IdentityAuthenticationServiceImpl  implements IdentityAuthenticatio
58 53
     @Override
59 54
     public IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication) {
60 55
         IdentityAuthentication identityAuthenticationselect = identityAuthenticationMapper.selectIdentityAuthentication(identityAuthentication);
61
-        if(identityAuthenticationselect!=null){
56
+        if (identityAuthenticationselect != null) {
62 57
             identityAuthenticationselect.setCertificationStatusName("已身份认证");
63
-        }else {
58
+        } else {
64 59
             IdentityAuthentication identityAuthenticationselectnew = new IdentityAuthentication();
65 60
             identityAuthenticationselectnew.setCertificationStatusName("未身份认证");
66 61
             identityAuthenticationselectnew.setCertificationStatus(0);
@@ -70,86 +65,157 @@ public class IdentityAuthenticationServiceImpl  implements IdentityAuthenticatio
70 65
 
71 66
     }
72 67
 
68
+    /**
69
+     * 检查是否已经认证的用户
70
+     *
71
+     * @param identityAuthentication
72
+     * @return
73
+     */
73 74
     @Override
74
-    public IdentityAuthentication selectIdentityAuthenticaEIDtoken() {
75
-        IdentityAuthentication identityAuthentication = new IdentityAuthentication();
76
-        try{
77
-            Credential authenti = new Credential(credentialSecretId, credentialSecretKey);
78
-            HttpProfile httpProfileIdenAuth = new HttpProfile();
79
-            httpProfileIdenAuth.setEndpoint("faceid.tencentcloudapi.com");
80
-            ClientProfile clientInv= new ClientProfile();
81
-            clientInv.setHttpProfile(httpProfileIdenAuth);
82
-            FaceidClient clientIdenAuth = new FaceidClient(authenti, "", clientInv);
83
-            // 实例化一个请求对象
84
-            GetEidTokenRequest reqest = new GetEidTokenRequest();
85
-            //设置请求参数
86
-            reqest.setMerchantId(merchantId);
87
-            GetEidTokenResponse respIdenAuth = clientIdenAuth.GetEidToken(reqest);
88
-            String respJSON = GetEidTokenResponse.toJsonString(respIdenAuth);
89
-            JSONObject objJSON = JSON.parseObject(respJSON);
90
-            String eidToken = objJSON.getString("EidToken");
91
-            String requestId = objJSON.getString("RequestId");
92
-            identityAuthentication.setEidToken(eidToken);
93
-        }catch (TencentCloudSDKException e) {
94
-            log.error("获取Eidtoke异常:", e);
95
-            throw new RuntimeException("获取Eidtoke异常");
75
+    public String checkIsAuthentication(IdentityAuthentication identityAuthentication) {
76
+        IdentityAuthentication identityAuthenticationselect = identityAuthenticationMapper.selectIdentityAuthentication(identityAuthentication);
77
+        if (identityAuthenticationselect != null) {
78
+            return "1";
79
+        } else {
80
+            return "0";
96 81
         }
82
+    }
97 83
 
98
-        return identityAuthentication;
84
+    /**
85
+     * 获取EIDtoken
86
+     *
87
+     * @return
88
+     */
89
+    @Override
90
+    public JSONObject selectIdentityAuthenticaEIDtoken() {
91
+        JSONObject objJSON = new JSONObject();
92
+        objJSON.put("EidToken", "");
93
+        try {
94
+            Credential cred = new Credential(credentialSecretId, credentialSecretKey);
95
+            // 实例化一个http选项,可选的,没有特殊需求可以跳过
96
+            HttpProfile httpProfile = new HttpProfile();
97
+            httpProfile.setEndpoint("faceid.tencentcloudapi.com");
98
+            // 实例化一个client选项,可选的,没有特殊需求可以跳过
99
+            ClientProfile clientProfile = new ClientProfile();
100
+            clientProfile.setHttpProfile(httpProfile);
101
+            // 实例化要请求产品的client对象,clientProfile是可选的
102
+            FaceidClient client = new FaceidClient(cred, "", clientProfile);
103
+            // 实例化一个请求对象,每个接口都会对应一个request对象
104
+            GetEidTokenRequest req = new GetEidTokenRequest();
105
+            req.setMerchantId(merchantId);
106
+            // 返回的resp是一个GetEidTokenResponse的实例,与请求对象对应
107
+            GetEidTokenResponse resp = client.GetEidToken(req);
108
+            // 输出json格式的字符串回包
109
+            String respJSON = GetEidTokenResponse.toJsonString(resp);
110
+            objJSON = JSON.parseObject(respJSON);
111
+        } catch (TencentCloudSDKException e) {
112
+            System.out.println(e.toString());
113
+            System.out.println("获取Eidtoken失败");
114
+        }
115
+        return objJSON;
116
+    }
99 117
 
118
+    /**
119
+     * 解密用户信息
120
+     */
121
+    public JSONObject DecodeUserInfo(String deskey, String userInfo) {
122
+        JSONObject parse = null;
123
+        try {
124
+            byte[] desKeyBytes = Base64.decode(deskey);
125
+            final SM2 sm2 = new SM2(privateKeyHexDecodeinfo, null, null);
126
+            sm2.usePlainEncoding();
127
+            byte[] sm4KeyBytes = sm2.decrypt(desKeyBytes);
128
+            SymmetricCrypto sm4 = SmUtil.sm4(sm4KeyBytes);
129
+            byte[] plaintext = sm4.decrypt(Base64.decode(userInfo));
130
+            if (plaintext != null && plaintext.length > 0) {
131
+                String s = new String(plaintext);
132
+                parse = JSON.parseObject(s);
133
+            }
134
+        } catch (Exception e) {
135
+            System.out.println(e.toString());
136
+        }
137
+        return parse;
100 138
     }
101 139
 
140
+    /**
141
+     * 小程序人脸核身后查询身份认证结果
142
+     *
143
+     * @param ientityAuthentication
144
+     * @return
145
+     */
102 146
     @Override
103 147
     @Transactional
104
-    public IdentityAuthentication selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication) {
148
+    public AjaxResult selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication) {
105 149
         String eidToken = ientityAuthentication.getEidToken();
106
-        Long userId = ientityAuthentication.getUserId();
107
-        String userName = ientityAuthentication.getUserName();
108
-        IdentityAuthentication IdentityAuthenticationRespon = new IdentityAuthentication();
109
-        IdentityAuthentication IdentityAuthenticationResult = new IdentityAuthentication();
110
-        if(StringUtils.isNotEmpty(eidToken)){
111
-            try{
112
-                Credential authenti = new Credential(credentialSecretId, credentialSecretKey);
113
-                HttpProfile httpProfileIdenAuth = new HttpProfile();
114
-                httpProfileIdenAuth.setEndpoint("faceid.tencentcloudapi.com");
115
-                ClientProfile clientInv= new ClientProfile();
116
-                clientInv.setHttpProfile(httpProfileIdenAuth);
117
-                FaceidClient clientIdenAuth = new FaceidClient(authenti, "", clientInv);
118
-                // 实例化一个请求对象
119
-                GetEidResultRequest reqest = new GetEidResultRequest();
120
-                //设置请求参数
121
-                reqest.setEidToken(eidToken);
122
-
123
-//                reqest.setInfoType("1");
124
-//                reqest.setInfoType("13");
125
-//                reqest.setInfoType("2");
126
-
127
-                //获得身份认证结果
128
-                GetEidResultResponse respIdenAuth = clientIdenAuth.GetEidResult(reqest);
129
-                String respJSON = GetEidResultResponse.toJsonString(respIdenAuth);
130
-                JSONObject objJSON = JSON.parseObject(respJSON);
131
-                IdentityAuthenticationRespon.setCertificationStatus(1);
132
-                IdentityAuthenticationRespon.setUserName(userName);
133
-                IdentityAuthenticationRespon.setUserId(userId);
134
-
135
-                JSONObject objEidInfo = JSON.parseObject(objJSON.getString("EidInfo"));
136
-//                identityAuthenticationMapper.insertIdentityAuthentication(IdentityAuthenticationRespon);
137
-                IdentityAuthenticationResult.setCertificationStatus(1);
138
-                IdentityAuthenticationResult.setCertificationStatusName("认证成功");
139
-            } catch (TencentCloudSDKException e) {
140
-                log.error("认证失败:", e);
141
-                throw new RuntimeException("认证失败");
142
-            }
143 150
 
151
+        try {
152
+            Credential cred = new Credential(credentialSecretId, credentialSecretKey);
153
+            // 实例化一个http选项,可选的,没有特殊需求可以跳过
154
+            HttpProfile httpProfile = new HttpProfile();
155
+            httpProfile.setEndpoint("faceid.tencentcloudapi.com");
156
+            // 实例化一个client选项,可选的,没有特殊需求可以跳过
157
+            ClientProfile clientProfile = new ClientProfile();
158
+            clientProfile.setHttpProfile(httpProfile);
159
+            // 实例化要请求产品的client对象,clientProfile是可选的
160
+            FaceidClient client = new FaceidClient(cred, "", clientProfile);
161
+            // 实例化一个请求对象,每个接口都会对应一个request对象
162
+            GetEidResultRequest req = new GetEidResultRequest();
163
+            req.setEidToken(eidToken);
164
+            // 返回的resp是一个GetEidResultResponse的实例,与请求对象对应
165
+            GetEidResultResponse resp = client.GetEidResult(req);
166
+            // 输出json格式的字符串回包
167
+            String s = GetEidResultResponse.toJsonString(resp);
168
+            JSONObject objJSON = JSON.parseObject(s);
169
+            //查看是否核验成功
170
+            JSONObject text = objJSON.getJSONObject("Text");
171
+            if (text != null) {
172
+                Integer comparestatus = text.getInteger("Comparestatus");
173
+                if (comparestatus != null && comparestatus == 0) {
174
+                    JSONObject eidInfo = objJSON.getJSONObject("EidInfo");
175
+                    if (eidInfo != null) {
176
+                        String desKey = eidInfo.getString("DesKey");
177
+                        String userInfo = eidInfo.getString("UserInfo");
178
+                        //1.解密用户的信息
179
+                        JSONObject info = DecodeUserInfo(desKey, userInfo);
180
+                        if (info != null) {
181
+                            String idcardno = info.getString("idnum");
182
+                            String name = info.getString("name");
183
+                            //2.在用户认证表中插入用户认证记录
184
+                            LoginUser loginUser = SecurityUtils.getLoginUser();
185
+                            IdentityAuthentication authentication = new IdentityAuthentication();
186
+                            /**
187
+                             * 用户名
188
+                             * 用户名id
189
+                             * 姓名
190
+                             * 身份证号
191
+                             * 认证时间
192
+                             * 认证状态0表示成功
193
+                             * 请求id
194
+                             */
195
+                            authentication.setUserName(loginUser.getUsername());
196
+                            authentication.setUserId(loginUser.getUserId());
197
+                            authentication.setName(name);
198
+                            authentication.setIdentityNo(idcardno);
199
+                            authentication.setCertificationTime(new Date());
200
+                            authentication.setCertificationStatus(0);
201
+                            authentication.setRequestId(objJSON.getString("RequestId"));
202
+                            try {
203
+                                identityAuthenticationMapper.insertIdentityAuthentication(authentication);
204
+                            } catch (Exception e) {
205
+                                System.out.println("认证记录新增失败");
206
+                            }
207
+
208
+                        }
209
+
210
+                    }
211
+                }
212
+            }
213
+            return AjaxResult.success();
214
+        } catch (TencentCloudSDKException e) {
215
+            System.out.println(e.toString());
144 216
         }
145
-        return IdentityAuthenticationResult;
217
+        return null;
146 218
     }
147 219
 
148 220
 
149
-
150
-
151
-
152
-
153
-
154
-
155 221
 }