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.

19 lines
599 B

2 years ago
import Cookies from 'js-cookie'
2 years ago
import router from '@/router'
2 years ago
const TokenKey = 'difficult_employee_query_token'
2 years ago
const TokenKsy_h5 = 'difficult_employee_query_token_h5'
2 years ago
export function getToken() {
2 years ago
let flag = /^\/h5.*/.test(router.currentRoute.path)
return Cookies.get(flag ? TokenKsy_h5 : TokenKey)
2 years ago
}
export function setToken(token) {
2 years ago
let flag = /^\/h5.*/.test(router.currentRoute.path)
return Cookies.set(flag ? TokenKsy_h5 : TokenKey, token)
2 years ago
}
export function removeToken() {
2 years ago
let flag = /^\/h5.*/.test(router.currentRoute.path)
return Cookies.remove(flag ? TokenKsy_h5 : TokenKey)
2 years ago
}