auth.js
433 Bytes
import Cookies from 'js-cookie'
const TokenKey = 'vue_admin_template_token'
export function getToken() {
return Cookies.get(TokenKey)
}
export function setToken(token) {
// let inFifteenMinutes = new Date(new Date().getTime() + 30 * 60 * 1000);
// return Cookies.set(TokenKey, token, { expires: inFifteenMinutes })
return Cookies.set(TokenKey, token)
}
export function removeToken() {
return Cookies.remove(TokenKey)
}