first commit

This commit is contained in:
Net 2024-04-02 11:02:16 +07:00
commit e8ec46d19f
60 changed files with 13652 additions and 0 deletions

42
src/router/index.ts Normal file
View file

@ -0,0 +1,42 @@
import { route } from 'quasar/wrappers';
import {
createMemoryHistory,
createRouter,
createWebHashHistory,
createWebHistory,
} from 'vue-router';
import { login } from 'src/services/keycloak';
import routes from './routes';
/*
* If not building with SSR mode, you can
* directly export the Router instantiation;
*
* The function below can be async too; either use
* async/await or return a Promise which resolves
* with the Router instance.
*/
export default route(function (/* { store, ssrContext } */) {
const createHistory = process.env.SERVER
? createMemoryHistory
: process.env.VUE_ROUTER_MODE === 'history'
? createWebHistory
: createWebHashHistory;
return new Promise((resolve) => {
login().then(() => {
const Router = createRouter({
scrollBehavior: () => ({ left: 0, top: 0 }),
routes,
// Leave this as is and make changes in quasar.conf.js instead!
// quasar.conf.js -> build -> vueRouterMode
// quasar.conf.js -> build -> publicPath
history: createHistory(process.env.VUE_ROUTER_BASE),
});
resolve(Router);
});
});
});

25
src/router/routes.ts Normal file
View file

@ -0,0 +1,25 @@
import { RouteRecordRaw } from 'vue-router';
const routes: RouteRecordRaw[] = [
{
path: '',
redirect: { name: 'Home' },
component: () => import('layouts/MainLayout.vue'),
children: [
{
path: '/',
name: 'Home',
component: () => import('pages/MainPage.vue'),
},
],
},
// Always leave this as last one,
// but you can also remove it
{
path: '/:catchAll(.*)*',
component: () => import('pages/error/NotFound.vue'),
},
];
export default routes;