release v2.0.0 #4

Merged
crimsen merged 481 commits from develop into master 2024-01-18 15:15:08 +00:00
2 changed files with 9 additions and 3 deletions
Showing only changes of commit d54b398c14 - Show all commits

View File

@ -40,9 +40,13 @@ export default boot<UserSessionState>(({ app, store, router }) => {
e.code === 'ECONNABORTED' ||
(e.response && e.response.status >= 502 && e.response.status <= 504)
) {
const current = router.currentRoute.value;
let next = current.path;
if ((current.name == 'login' || current.name == 'offline') && current.query.redirect)
next = <string>current.query.redirect;
return router.push({
name: 'offline',
query: { redirect: router.currentRoute.value.fullPath },
query: { redirect: next },
});
} else if (e.response && e.response.status == 401) {
if (router.currentRoute.value.name !== 'login')

View File

@ -46,8 +46,10 @@ export default defineComponent({
const ival = setInterval(() => {
reload.value -= 1;
if (reload.value === 0) {
const path = <string | null>router.currentRoute.value.query.redirect || '/login';
void router.replace({ path: path });
const path = router.currentRoute.value.query.redirect;
console.log('Offline: ');
console.log(path);
void router.replace(path ? { path: <string>path } : { name: 'login' });
}
}, 1000);
onUnmounted(() => clearInterval(ival));