This commit is contained in:
z9130 2024-09-29 14:39:00 +08:00
commit 29f2ff3e32
3 changed files with 8 additions and 4 deletions

View File

@ -47,7 +47,7 @@ const { onAuthRequired, onResponseRefreshToken } =
return isExpired;
},
/** 当token过期时触发在此函数中触发刷新token */
handler: async (response, method) => {
handler: async (_response, _method) => {
console.warn('Access token or refresh token is invalid or expired. ');
const accessStore = useAccessStore();
const authStore = useAuthStore();
@ -58,9 +58,10 @@ const { onAuthRequired, onResponseRefreshToken } =
) {
accessStore.setLoginExpired(true);
} else {
await authStore.logout();
await authStore.logout(false);
}
throw new Error('登录已过期,请重新登录');
// const userStore = useUserStore();
// try {
// let rToken = userStore.refreshToken;

View File

@ -89,7 +89,10 @@ const { authPanelCenter, authPanelLeft, authPanelRight, isDark } =
</div> -->
<!-- 右侧认证面板 -->
<AuthenticationFormView class="min-h-full w-[34%] flex-1" />
<AuthenticationFormView
v-if="authPanelRight"
class="min-h-full w-[34%] flex-1"
/>
</div>
</template>

View File

@ -58,7 +58,7 @@ const { onAuthRequired, onResponseRefreshToken } =
) {
accessStore.setLoginExpired(true);
} else {
await authStore.logout();
await authStore.logout(false);
}
throw new Error('登录已过期,请重新登录');
// const userStore = useUserStore();