feat: implement logout on 401 response and update query handling
refactor: replace Button with div for consistent styling in AIEditorLink refactor: update navigation handling in AppVersionList and remove LayoutMain wrapper refactor: remove unused LayoutMain imports and components across various pages fix: ensure user app list is set correctly in useUserAppStore fix: update login URL format in AuthProvider fix: adjust layout styles in EnvPage and other pages for better responsiveness chore: update route definitions and create new routes for apps, config, domain, flowme, org, remote, token, user, and users style: replace Button with div for delete confirmation in various components fix: ensure correct handling of user profile image source
This commit is contained in:
@@ -3,7 +3,15 @@ import { QueryLoginBrowser } from '@kevisual/api/query-login'
|
||||
import { useContextKey } from '@kevisual/context';
|
||||
export const query = useContextKey('query', new Query({
|
||||
url: '/api/router',
|
||||
|
||||
}));
|
||||
query.afterResponse = async (response, ctx) => {
|
||||
if (response.code === 401) {
|
||||
queryLogin.logout();
|
||||
setTimeout(() => { location.reload() }, 2000);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
export const queryClient = useContextKey('queryClient', new Query({
|
||||
url: '/client/router',
|
||||
|
||||
Reference in New Issue
Block a user