feat: 增加 sso 单点登录

This commit is contained in:
YunaiV
2025-04-16 18:35:03 +08:00
parent f27774c1fc
commit 54f9d0c10f
7 changed files with 222 additions and 3 deletions

View File

@@ -51,6 +51,9 @@ function createRequestClient(baseURL: string, options?: RequestClientOptions) {
async function doRefreshToken() {
const accessStore = useAccessStore();
const refreshToken = accessStore.refreshToken as string;
if (!refreshToken) {
throw new Error('Refresh token is null!');
}
const resp = await refreshTokenApi(refreshToken);
const newToken = resp?.data?.data?.accessToken;
// add by 芋艿:这里一定要抛出 resp.data从而触发 authenticateResponseInterceptor 中,刷新令牌失败!!!