chenyao
2025-02-18 b5591da48cf8cc2a3c3f76eec86dfdfa5bf47485
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import Cookies from 'js-cookie';
const TokenKey = 'saber-access-token';
const RefreshTokenKey = 'saber-refresh-token';
export function getToken() {
    return Cookies.get(TokenKey, {
        path: '/'
    });
}
 
export function setToken(token:any) {
    return Cookies.set(TokenKey, token, {
        expires: 7,
        path: '/'
    });
}
 
export function getRefreshToken() {
    return Cookies.get(RefreshTokenKey);
}
 
export function setRefreshToken(token:any) {
    return Cookies.set(RefreshTokenKey, token, {
        expires: 7,
        path: '/'
    });
}
 
export function removeToken() {
    return Cookies.remove(TokenKey);
}
 
export function removeRefreshToken() {
    return Cookies.remove(RefreshTokenKey);
}