12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import Cookies from 'js-cookie'
- export const TokenKey = 'vue_admin_template_token'
- export function getToken (name = TokenKey) {
- return Cookies.get(name)
- }
- export function setToken (name = TokenKey, token) {
- return Cookies.set(name, token)
- }
- export function setUserId (id) {
- return sessionStorage.setItem("User_Id", id)
- }
- export function getUserId () {
- return sessionStorage.getItem("User_Id")
- }
- export function removeToken (name = TokenKey) {
- return Cookies.remove(name)
- }
- export function setCodeToken (token) {
- return Cookies.set('codeToken', token)
- }
- export function getCodeToken () {
- return Cookies.get('codeToken')
- }
- export function setLogId(id) {
- sessionStorage.setItem('LogId', id)
- }
- export function getLogId() {
- return sessionStorage.getItem('LogId')
- }
- export function removeLogId() {
- sessionStorage.removeItem('LogId')
- }
|