auth.js 355 字节
Newer Older
yma16's avatar
yma16 已提交
1 2
import { getCookie, setCookie, removeCookie } from './util.cookies.js'
const TOKEN_KEY = 'token'
3
/**
yma16's avatar
yma16 已提交
4 5
     * 获取tonken
     */
6
export function getToken () {
yma16's avatar
yma16 已提交
7 8
    return getCookie(TOKEN_KEY)
}
9
export function setToken (token, optins) {
yma16's avatar
yma16 已提交
10 11
    return setCookie(TOKEN_KEY, token, optins)
}
12
export function removeToken () {
yma16's avatar
yma16 已提交
13 14
    return removeCookie(TOKEN_KEY)
}