|
// token
|
const TokenKey = 'adminToken'
|
export function getToken() {
|
return sessionStorage.getItem(TokenKey)
|
}
|
|
export function setToken(token) {
|
return sessionStorage.setItem(TokenKey, token)
|
}
|
|
export function removeToken() {
|
return sessionStorage.removeItem(TokenKey)
|
}
|
|
// userData
|
const userDataKey = 'userData'
|
export function getUserData() {
|
return sessionStorage.getItem(userDataKey)
|
}
|
|
export function setUserData(data) {
|
return sessionStorage.setItem(userDataKey, JSON.stringify(data))
|
}
|
|
export function removeUserData() {
|
return sessionStorage.removeItem(userDataKey)
|
}
|