huanghongfa
2020-12-22 094e1d5048d3e3f22277659c60c653955ae631fc
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/controller/BaseController.java
File was renamed from springcloud_k8s_panzhihuazhihuishequ/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/controller/BaseController.java
@@ -9,6 +9,7 @@
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;
@@ -22,6 +23,7 @@
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2020-11-24 09:31
 **/
@Slf4j
public class BaseController {
    /**
     * 获取request对象
@@ -82,8 +84,11 @@
        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;