|
@@ -35,7 +35,7 @@ export function getToken(): DataInfo<number> {
|
|
|
export function setToken(data: DataInfo<Date>) {
|
|
|
let expires = 0;
|
|
|
const { accessToken, refreshToken } = data;
|
|
|
- expires = new Date(data.expires).getTime();
|
|
|
+ expires = new Date(data.expires).getTime(); // 如果后端直接设置时间戳,将此处代码改为expires = data.expires,然后把上面的DataInfo<Date>改成DataInfo<number>即可
|
|
|
const cookieString = JSON.stringify({ accessToken, expires });
|
|
|
|
|
|
expires > 0
|