admin-fe/src/utils/auth.js
2019-03-23 14:09:48 +00:00

28 lines
528 B
JavaScript

import Cookies from 'js-cookie'
const TokenKey = 'Admin-Token'
const AuthHostKey = 'Auth-Host'
export function getToken() {
return Cookies.get(TokenKey)
}
export function setToken(token) {
return Cookies.set(TokenKey, token)
}
export function removeToken() {
return Cookies.remove(TokenKey)
}
export function getAuthHost() {
return Cookies.get(AuthHostKey)
}
export function setAuthHost(token) {
return Cookies.set(AuthHostKey, token)
}
export function removeAuthHost() {
return Cookies.remove(AuthHostKey)
}