|
@@ -21,6 +21,7 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -39,6 +40,7 @@ import java.util.stream.Collectors;
|
|
|
* @version 2.0
|
|
|
* @date 2022/10/03
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
@Api(tags = {"数据鉴权"})
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/api/auth-service/" + VersionUtils.VERSION_UID + "/")
|
|
@@ -61,9 +63,15 @@ public class DataAuthApiV2Controller {
|
|
|
if (StrUtil.isBlank(resourceId)) {
|
|
|
return ResultRespVO.resultEnumMessage(BusinessRespEnum.PARAM_ERROR);
|
|
|
}
|
|
|
-
|
|
|
- DecodedJWT decode = JWT.decode(appTokenId);
|
|
|
- String idcard = decode.getClaim("idCard").asString();
|
|
|
+ // todo 应用令牌中不包含人员身份证号,需要根据应用令牌查询人员身份证号
|
|
|
+ String idcard;
|
|
|
+ try {
|
|
|
+ DecodedJWT decode = JWT.decode(appTokenId);
|
|
|
+ idcard = decode.getClaim("idCard").asString();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("appTokenId parse error.", e);
|
|
|
+ return ResultRespVO.resultEnumMessage(BusinessRespEnum.TOKEN_FAIL);
|
|
|
+ }
|
|
|
if (StringUtils.isBlank(idcard)) {
|
|
|
return ResultRespVO.resultEnumMessage(BusinessRespEnum.TOKEN_FAIL);
|
|
|
}
|