File was renamed from springcloud_k8s_panzhihuazhihuishequ/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/controller/BaseController.java |
| | |
| | | import com.panzhihua.common.utlis.AES; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.SneakyThrows; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-24 09:31 |
| | | **/ |
| | | @Slf4j |
| | | public class BaseController { |
| | | /** |
| | | * 获取request对象 |
| | |
| | | if (empty) { |
| | | throw new UnAuthenticationException("获取登录人信息失败"); |
| | | } |
| | | log.info("userInfo【{}】",userInfo); |
| | | byte[] bytes = AES.parseHexStr2Byte(userInfo); |
| | | log.info("bytes【{}】",bytes); |
| | | byte[] decrypt = AES.decrypt(bytes, Constants.AES_KEY); |
| | | log.info("decrypt【{}】",decrypt); |
| | | userInfo=new String(decrypt); |
| | | LoginUserInfoVO loginUserInfoVO= JSONObject.parseObject(userInfo,LoginUserInfoVO.class); |
| | | return loginUserInfoVO; |