[UI] dialog and redirect for no active domain
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
createWebHashHistory,
|
||||
createWebHistory,
|
||||
} from 'vue-router';
|
||||
import { Dialog } from 'quasar'
|
||||
|
||||
import routes from './routes';
|
||||
import { useAuthStore } from 'stores/useAuthStore';
|
||||
@@ -47,6 +48,20 @@ export default route(function (/* { store, ssrContext } */) {
|
||||
authStore.returnUrl = to.fullPath;
|
||||
return '/login';
|
||||
}
|
||||
|
||||
// redirect to domain setting page if no domain exist
|
||||
const domainPages = [...publicPages, '/domain', '/userDomain', '/user'];
|
||||
if (!authStore.hasDomain && !domainPages.includes(to.path)) {
|
||||
Dialog.create({
|
||||
title: '注意',
|
||||
message: '既定/利用可能なドメインはありません。<br>ドメイン管理ページに遷移して処理します。',
|
||||
html: true,
|
||||
persistent: true,
|
||||
}).onDismiss(() => {
|
||||
console.log('Dialog dismissed. You can do some clean up here')
|
||||
})
|
||||
return '/domain';
|
||||
}
|
||||
});
|
||||
return routerInstance;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user