修复登录面板有时不见的情况
This commit is contained in:
parent
68432d4d68
commit
478031d365
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ const { onAuthRequired, onResponseRefreshToken } =
|
|||
) {
|
||||
accessStore.setLoginExpired(true);
|
||||
} else {
|
||||
await authStore.logout();
|
||||
await authStore.logout(false);
|
||||
}
|
||||
throw new Error('登录已过期,请重新登录');
|
||||
// const userStore = useUserStore();
|
||||
|
|
Loading…
Reference in New Issue