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.
|
|
|
|
import Cookies from 'js-cookie'
|
|
|
|
|
import router from '@/router'
|
|
|
|
|
const TokenKey = 'difficult_employee_token'
|
|
|
|
|
const TokenKsy_h5 = 'difficult_employee_token_h5'
|
|
|
|
|
export function getToken() {
|
|
|
|
|
let flag = /\/h5.*/.test(window.location.href)
|
|
|
|
|
return Cookies.get(flag ? TokenKsy_h5 : TokenKey)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function setToken(token) {
|
|
|
|
|
let flag = /\/h5.*/.test(window.location.href)
|
|
|
|
|
return Cookies.set(flag ? TokenKsy_h5 : TokenKey, token)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function removeToken() {
|
|
|
|
|
let flag = /\/h5.*/.test(window.location.href)
|
|
|
|
|
return Cookies.remove(flag ? TokenKsy_h5 : TokenKey)
|
|
|
|
|
}
|