|
|
|
|
@ -71,6 +71,8 @@ public class CommonApiController extends BladeController { |
|
|
|
|
@ApiOperationSupport(order = 3) |
|
|
|
|
@ApiOperation(value = "保存用户头像", notes = "保存用户头像") |
|
|
|
|
public R saveCupImg(@RequestParam String data, HttpServletRequest request) throws JsonProcessingException, InvalidCipherTextException, UnsupportedEncodingException { |
|
|
|
|
long starttime = System.currentTimeMillis(); |
|
|
|
|
System.out.println("开始保存用户头像:"+starttime); |
|
|
|
|
if (Func.isBlank(data)) { |
|
|
|
|
return R.fail("请求数据为空"); |
|
|
|
|
} |
|
|
|
|
@ -87,22 +89,25 @@ public class CommonApiController extends BladeController { |
|
|
|
|
String info1 = Sm2Utils.decrypt(interfaceToken,"00c308b1ca5c0bd452e52816af5f16c3baf0bbff8587d32b63ccb23bc8e4f73759"); |
|
|
|
|
String info = Sm2Utils.decrypt(info1,"3c57e96dac2d6d0dfd92e400ebb609e584b148b755968d898bd25f226aa5b636"); |
|
|
|
|
System.out.println("保存用户头像token解密后的内容是:"+info); |
|
|
|
|
// 创建ObjectMapper实例
|
|
|
|
|
ObjectMapper objectMapper = new ObjectMapper(); |
|
|
|
|
if(!info.contains("该票据不存在或已过期")){ |
|
|
|
|
// 创建ObjectMapper实例
|
|
|
|
|
ObjectMapper objectMapper = new ObjectMapper(); |
|
|
|
|
|
|
|
|
|
// 解析JSON字符串
|
|
|
|
|
JsonNode rootNode = objectMapper.readTree(info); |
|
|
|
|
// 解析JSON字符串
|
|
|
|
|
JsonNode rootNode = objectMapper.readTree(info); |
|
|
|
|
|
|
|
|
|
// 获取data字段的值(这是一个JSON字符串)
|
|
|
|
|
String dataJson = rootNode.get("data").asText(); |
|
|
|
|
// 获取data字段的值(这是一个JSON字符串)
|
|
|
|
|
String dataJson = rootNode.get("data").asText(); |
|
|
|
|
|
|
|
|
|
// 解析data字段的JSON字符串
|
|
|
|
|
JsonNode dataNode = objectMapper.readTree(dataJson); |
|
|
|
|
// 解析data字段的JSON字符串
|
|
|
|
|
JsonNode dataNode = objectMapper.readTree(dataJson); |
|
|
|
|
|
|
|
|
|
// 获取certNo的值
|
|
|
|
|
cardNo = dataNode.get("certNo").asText(); |
|
|
|
|
// 获取certNo的值
|
|
|
|
|
cardNo = dataNode.get("certNo").asText(); |
|
|
|
|
|
|
|
|
|
System.out.println("保存用户头像获取到的身份证号是:"+cardNo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
System.out.println("保存用户头像获取到的身份证号是:"+cardNo); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -114,22 +119,27 @@ public class CommonApiController extends BladeController { |
|
|
|
|
|
|
|
|
|
if (Func.isEmpty(cupImgCheck)) { |
|
|
|
|
cupImgService.save(cupImg); |
|
|
|
|
System.out.println("新增用户头像成功:"+cardNo); |
|
|
|
|
} else { |
|
|
|
|
cupImgCheck.setCupImg(cupImg.getCupImg()); |
|
|
|
|
cupImgService.saveOrUpdate(cupImgCheck); |
|
|
|
|
System.out.println("更新用户头像成功:"+cardNo); |
|
|
|
|
} |
|
|
|
|
CupImgCache.clearCupImgCache(cupImg.getCupCardNo()); |
|
|
|
|
long endtime = System.currentTimeMillis(); |
|
|
|
|
System.out.println("结束保存用户头像:" + endtime); |
|
|
|
|
System.out.println("保存身份证号:"+cardNo+"用户头像用时:"+ (starttime - endtime) / 1000 + "秒"); |
|
|
|
|
return R.status(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 保存用户头像 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/save-cup-img2") |
|
|
|
|
/*@PostMapping("/save-cup-img2") |
|
|
|
|
@ApiOperationSupport(order = 3) |
|
|
|
|
@ApiOperation(value = "保存用户头像", notes = "保存用户头像") |
|
|
|
|
public R saveCupImg2(@RequestParam String data) throws InvalidCipherTextException, UnsupportedEncodingException { |
|
|
|
|
/*if (Func.isBlank(data)) { |
|
|
|
|
*//*if (Func.isBlank(data)) {
|
|
|
|
|
return R.fail("请求数据为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -147,7 +157,7 @@ public class CommonApiController extends BladeController { |
|
|
|
|
cupImgService.saveOrUpdate(cupImgCheck); |
|
|
|
|
} |
|
|
|
|
CupImgCache.clearCupImgCache(cupImg.getCupCardNo()); |
|
|
|
|
return R.status(true);*/ |
|
|
|
|
return R.status(true);*//*
|
|
|
|
|
if (Func.isBlank(data)) { |
|
|
|
|
return R.fail("请求数据为空"); |
|
|
|
|
} |
|
|
|
|
@ -165,5 +175,5 @@ public class CommonApiController extends BladeController { |
|
|
|
|
} |
|
|
|
|
CupImgCache.clearCupImgCache(cupImg.getCupCardNo()); |
|
|
|
|
return R.status(true); |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
} |
|
|
|
|
|