|
@@ -1,6 +1,8 @@
|
|
|
package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.controller;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.auth0.jwt.JWT;
|
|
|
+import com.auth0.jwt.interfaces.DecodedJWT;
|
|
|
import com.dragoninfo.dcuc.app.entity.ApplyInfo;
|
|
|
import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
|
|
|
import com.dragoninfo.dcuc.auth.auth.dto.AppDataSensitiveLevelDTO;
|
|
@@ -25,6 +27,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.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
@@ -41,6 +44,7 @@ import java.util.stream.Collectors;
|
|
|
* @author yica huangzqa
|
|
|
* @date 2021/2/24 19:11
|
|
|
**/
|
|
|
+@Slf4j
|
|
|
@RestController
|
|
|
@Api(tags = {"权限管理对外开放接口"})
|
|
|
@RequestMapping(value = "/api/auth-service/" + VersionUtils.VERSION_UID_V1 + "/")
|
|
@@ -74,8 +78,12 @@ public class AuthServiceController {
|
|
|
if (!checkUserToken) {
|
|
|
return ApiResult.setFailMessage("用户令牌无效");
|
|
|
}
|
|
|
- // todo 获取用户身份证号
|
|
|
- String idcard = userToken;
|
|
|
+
|
|
|
+ DecodedJWT decode = JWT.decode(userToken);
|
|
|
+ String idcard = decode.getClaim("idcard").asString();
|
|
|
+
|
|
|
+ log.info("UserToken:{} , idcard:{}", userToken, idcard);
|
|
|
+
|
|
|
UserInfo userInfo = userFacade.detailBySfzh(idcard);
|
|
|
if (userInfo == null) {
|
|
|
return ApiResult.setFailMessage("用户不存在");
|