|
@@ -3,7 +3,11 @@ import Cookies from 'js-cookie'
|
|
|
const TokenKey = 'X-JZ-Admin-Token'
|
|
|
|
|
|
export function getToken() {
|
|
|
- return Cookies.get(TokenKey)
|
|
|
+ let token = Cookies.get(TokenKey);
|
|
|
+ if (token.includes(":")) {
|
|
|
+ token = token.split(":")[1]
|
|
|
+ }
|
|
|
+ return token;
|
|
|
}
|
|
|
|
|
|
export function setToken(token) {
|
|
@@ -11,13 +15,14 @@ export function setToken(token) {
|
|
|
}
|
|
|
|
|
|
export function removeToken() {
|
|
|
+ Cookies.remove("login")
|
|
|
return Cookies.remove(TokenKey)
|
|
|
}
|
|
|
|
|
|
export function setLoginStatus(status) {
|
|
|
- return Cookies.set('loginStatus', status)
|
|
|
+ return Cookies.set('login', status)
|
|
|
}
|
|
|
|
|
|
export function getLoginStatus() {
|
|
|
- return Cookies.get('loginStatus')
|
|
|
+ return Cookies.get('login')
|
|
|
}
|