|
@@ -114,19 +114,22 @@ class Request { |
|
|
this.toLoginPage(); |
|
|
this.toLoginPage(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const [error, {data}] = await loginService.rerefshToken(refreshToken); |
|
|
|
|
|
|
|
|
const [error, {code, data, msg}] = await loginService.rerefshToken(refreshToken); |
|
|
|
|
|
|
|
|
if (error) { |
|
|
|
|
|
|
|
|
if (error || code !== 0) { |
|
|
this.toLoginPage(); |
|
|
this.toLoginPage(); |
|
|
|
|
|
useGlobalStore.setState({ |
|
|
|
|
|
refreshToken: '', |
|
|
|
|
|
token: '', |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
useGlobalStore.setState({ |
|
|
|
|
|
refreshToken: data.refreshToken, |
|
|
|
|
|
token: data.accessToken, |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
useGlobalStore.setState({ |
|
|
|
|
|
refreshToken: data.refreshToken, |
|
|
|
|
|
token: data.accessToken, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.refreshTokenFlag = false; |
|
|
this.refreshTokenFlag = false; |
|
|
|
|
|
|
|
|
this.requestByQueue(); |
|
|
this.requestByQueue(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|