rt-sim-training-client/src/utils/auth.js
2019-11-14 13:59:33 +08:00

26 lines
707 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import SessionStorage from 'sessionstorage';
const TokenKey = 'Admin-Token';
// 设置教学实训仿真系统token, 设置城市轨道交通设计平台token
export function getToken() {
return SessionStorage.getItem(TokenKey);
}
export function setToken(token) {
return SessionStorage.setItem(TokenKey, token);
}
export function removeToken() {
return SessionStorage.removeItem(TokenKey);
}
// 操作sessionStorage
export function getSessionStorage(key) {
return SessionStorage.getItem(key);
}
export function setSessionStorage(key, value) {
return SessionStorage.setItem(key, value);
}
export function removeSessionStorage(key) {
return SessionStorage.removeItem(key);
}