import Cookie from 'js-cookie';

const ACCESS_TICKET_KEY = "ticket"

// 设置ticket
export function setTicket(ticket) {
    Cookie.set(ACCESS_TICKET_KEY, ticket, { expires: 7 }) // 设置有效期 7 天，不设置默认同 sessionStorage 有效期一致
}

// 获取ticket
export function getTicket() {
    return Cookie.get(ACCESS_TICKET_KEY)
}

//删除ticket
export function removeTicket() {
    Cookie.remove(ACCESS_TICKET_KEY);
}
