package com.changfa.constants;

import com.alibaba.fastjson.JSON;
import com.changfa.dto.UserBaseDto;
import com.changfa.entity.TUser;
import com.changfa.utils.JwtUtil;
import org.apache.shiro.SecurityUtils;

public class LoginConstant {
    public static TUser currentUser(){
        return JSON.parseObject(JwtUtil.getTokenData(SecurityUtils.getSubject().getSession().getId().toString()).toString(), UserBaseDto.class).getUser();
    }

    public static UserBaseDto userBaseInfo(){
        return JSON.parseObject(JwtUtil.getTokenData(SecurityUtils.getSubject().getSession().getId().toString()).toString(), UserBaseDto.class);
    }
}
