add: company info & edit company view

This commit is contained in:
Alexandro Uc Santos
2023-11-29 21:07:46 -06:00
parent dd674b053b
commit df8aff2745
18 changed files with 548 additions and 48 deletions

View File

@@ -1,5 +1,8 @@
import { createRouter, createWebHistory } from 'vue-router'
import AuthLayout from '../layouts/AuthLayout.vue'
// import {useAuthStore} from '../stores/auth';
// const authStore = useAuthStore();
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
@@ -25,8 +28,8 @@ const router = createRouter({
component: () => import('../views/RecoveryPasswordView.vue'),
},
{
path: 'empresa',
name: 'company',
path: 'registro-empresa',
name: 'register-company',
component: () => import('../views/CompleteRegisterView.vue')
}
]
@@ -42,11 +45,36 @@ const router = createRouter({
name: 'home',
component: () => import('../views/HomeView.vue'),
},
{
path: 'empresa',
name: 'company',
component: () => import('../views/MyCompanyView.vue'),
},
{
path: 'ubicaciones',
name: 'locations',
component: () => import('../views/LocationsView.vue'),
},
{
path: 'publicaciones',
name: 'published',
component: () => import('../views/PublishedView.vue'),
},
{
path: 'usuarios',
name: 'users',
component: () => import('../views/UsersView.vue'),
},
{
path: 'calculadora',
name: 'calculator',
component: () => import('../views/CalculatorView.vue'),
},
{
path: 'reportes',
name: 'reports',
component: () => import('../views/ReportsView.vue'),
},
{
path: 'calendario',
name: 'calendar',
@@ -70,24 +98,14 @@ const router = createRouter({
router.beforeEach( async(to, from, next) => {
const requiresAuth = to.matched.some(url => url.meta.requiresAuth)
const session = localStorage.getItem('session');
// console.log('--------------- SE EJECUTA -----------------');
// console.log(session);
// console.log('--------------- FIN -----------------');
console.log('Se ejecuta router');
if(requiresAuth) {
//Comprobamos si el usuario esta authenticado
if(session) {
// try {
// const resp = await renewToken();
// if(resp.msg == 'success') {
// next();
// } else {
// next({name: 'login'})
// }
// } catch (error) {
// console.log(error);
// next({name: 'login'})
// if(!authStore.user) {
// await authStore.checkSession();
next();
// }
next();
} else {
next({name: 'login'})
}