You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.5 KiB
65 lines
1.5 KiB
import Cookies from 'js-cookie' |
|
|
|
let tokenKey = 'h5Token' |
|
// const TokenKey = 'Authorization' |
|
// const NetWorkId = 'networkId' |
|
// const UserName = 'username' |
|
// const PassWord = 'password' |
|
// const Checked = 'checked' |
|
|
|
export function getToken() { |
|
return sessionStorage.getItem(tokenKey) |
|
} |
|
|
|
export function setToken(token) { |
|
sessionStorage.setItem(tokenKey, token) |
|
} |
|
|
|
export function removeToken() { |
|
sessionStorage.removeItem(tokenKey) |
|
} |
|
|
|
// export function setNet(networkId) { |
|
// return Cookies.set(NetWorkId, networkId, { expires: 7 }) |
|
// } |
|
|
|
// export function setUsername(username) { |
|
// return Cookies.set(UserName, username, { expires: 7 }) |
|
// } |
|
|
|
// export function setPassword(password) { |
|
// return Cookies.set(PassWord, password, { expires: 7 }) |
|
// } |
|
|
|
// export function getNet(networkId) { |
|
// return Cookies.get(NetWorkId) |
|
// } |
|
|
|
// export function getUsername(username) { |
|
// return Cookies.get(UserName) |
|
// } |
|
|
|
// export function getPassword(password) { |
|
// return Cookies.get(PassWord) |
|
// } |
|
|
|
// export function setChecked(checked) { |
|
// return Cookies.set(Checked, checked, { expires: 7 }) |
|
// } |
|
|
|
// export function getChecked() { |
|
// return Cookies.get(Checked) |
|
// } |
|
|
|
// export function removeNet() { |
|
// return Cookies.remove(NetWorkId) |
|
// } |
|
// export function removeChecked() { |
|
// return Cookies.remove(Checked) |
|
// } |
|
// export function removeUsername() { |
|
// return Cookies.remove(UserName) |
|
// } |
|
// export function removePassword() { |
|
// return Cookies.remove(PassWord) |
|
// }
|
|
|