You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
457 B
JavaScript

8 months ago
import Cookies from 'js-cookie'
//为了防止同一套框架下面token 混用的情况 获取域名+端口区分开
// const host = window.location.host + window.location.port;
// const TokenKey = host+'Admin-Token'
const TokenKey = 'Admin-Token'
export function getToken() {
return Cookies.get(TokenKey)
}
export function setToken(token) {
return Cookies.set(TokenKey, token)
}
export function removeToken() {
return Cookies.remove(TokenKey)
}