nidapeng
2024-05-06 8ea9463705d26f07a279bab974769a5ceed43415
server/system_service/src/main/java/com/doumee/api/BaseController.java
@@ -32,17 +32,10 @@
     * @author Eva.Caesar Liu
     * @date 2023/03/21 14:49
     */
    protected LoginUserInfo getLoginUser () {
        return (LoginUserInfo)SecurityUtils.getSubject().getPrincipal();
    }
    /**
     * 获取当前登录用户
     * @author Eva.Caesar Liu
     * @date 2023/03/21 14:49
     */
    protected LoginUserInfo getLoginUser (String token) {
        if (token == null || token.isEmpty()) {
            throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"未登录");
               return (LoginUserInfo)SecurityUtils.getSubject().getPrincipal();
//            throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"未登录");
        }
        String userinfo =(String) stringRedisTemplate.opsForValue().get(Constants.REDIS_TOKEN_KEY + token);
        if (StringUtils.isBlank(userinfo)) {