|
@@ -3999,12 +3999,13 @@ public class ApiController {
|
|
|
@GetMapping(value = "/eid")
|
|
|
public R<?> getEidToken(@RequestParam(value = "idCard") String idCard,
|
|
|
@RequestParam(value = "realName") String realName,
|
|
|
- @RequestParam(value = "endType") String endType) {
|
|
|
+ @RequestParam(value = "endType", required = false) String endType){
|
|
|
|
|
|
+ endType = upmsConfig.getEndType();
|
|
|
|
|
|
String tokenUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/eid?idCard={idCard}&realName={realName}&endType={endType}";
|
|
|
|
|
|
- ResponseEntity<String> tokenResult = new RestTemplate().getForEntity(tokenUrl, String.class, idCard, realName, endType);
|
|
|
+ ResponseEntity<String> tokenResult = new RestTemplate().getForEntity(tokenUrl, String.class, idCard,realName, endType);
|
|
|
|
|
|
log.info("获取e-token:{}", tokenResult.getBody());
|
|
|
|
|
@@ -4024,8 +4025,9 @@ public class ApiController {
|
|
|
*/
|
|
|
@GetMapping(value = "/eid/result")
|
|
|
public R<?> getEidResult(@RequestParam(value = "token") String token,
|
|
|
- @RequestParam(value = "endType") String endType) {
|
|
|
+ @RequestParam(value = "endType") String endType){
|
|
|
|
|
|
+ endType = upmsConfig.getEndType();
|
|
|
|
|
|
String tokenUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/eid/result?token={token}&endType={endType}";
|
|
|
|
|
@@ -4039,18 +4041,13 @@ public class ApiController {
|
|
|
cn.hutool.json.JSONObject data = jsonObject.getJSONObject("data");
|
|
|
if (data != null) {
|
|
|
if (CommonConstants.SUCCESS.equals(data.getInt("compareCode"))) {
|
|
|
- // 认证成功,则保存
|
|
|
- SysUserExtRecord userExtRecord = new SysUserExtRecord();
|
|
|
- userExtRecord.setRealName(data.getStr("realName"));
|
|
|
- userExtRecord.setIdCardNumber(data.getStr("idCard"));
|
|
|
- userExtRecord.setBestFrameBase64(data.getStr("bestFrameBase64"));
|
|
|
- userExtRecord.setBestFrameUrl(data.getStr("bestFrameUrl"));
|
|
|
- userExtRecord.setIdCardFrontBase64(data.getStr("idCardFrontBase64"));
|
|
|
- userExtRecord.setIdCardBackBase64(data.getStr("idCardBackBase64"));
|
|
|
- userExtRecord.setIdCardFrontUrl(data.getStr("idCardFrontUrl"));
|
|
|
- userExtRecord.setIdCardBackUrl(data.getStr("idCardBackUrl"));
|
|
|
- userExtRecord.setEtoken(data.getStr("etoken"));
|
|
|
- sysUserExtRecordService.saveUserExtRecord(userExtRecord);
|
|
|
+
|
|
|
+ Boolean absent = redisTemplate.opsForValue()
|
|
|
+ .setIfAbsent(CacheConstants.EID_RESULT_KEY + token, tokenResult.getBody(), 30, TimeUnit.SECONDS);
|
|
|
+ if (absent) {
|
|
|
+ // 认证成功,则保存
|
|
|
+ sysUserExtRecordService.eidResultHandler(data);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|