package com.icloud.server.web.shiro.handler;


/**
 * @description: 保存用户会话
 * @author: zjbing
 * @create: 2021-01-13 14:31
 **/
public class LoginInfoThreadLocal {

    private static final ThreadLocal<UserToken> context = new ThreadLocal<>();

    public static void setContext(UserToken userToken) {
        context.set(userToken);
    }

    public static UserToken getContext() {

        return context.get();
    }

    public static void clear() {
        context.remove();
    }
}
