rutas validadas
This commit is contained in:
parent
94d21decb6
commit
173965a9bf
@ -137,9 +137,6 @@ export default {
|
||||
this.obtenerCatalogoModulo()
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerCatalogoInstitucion()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -119,7 +119,6 @@ export default {
|
||||
this.obtenerCatalogoModulo()
|
||||
},
|
||||
},
|
||||
created() {},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -68,6 +68,7 @@
|
||||
:msjWarning="`¿Estas segur@ de querer ${
|
||||
institucion.activo ? 'desactivar' : 'activar'
|
||||
} esta institución?`"
|
||||
labelDisabled
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -19,6 +19,7 @@
|
||||
:msjWarning="`¿Estas segur@ de querer ${
|
||||
modulo.activo ? 'desactivar' : 'activar'
|
||||
} este módulo?`"
|
||||
labelDisabled
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -388,6 +388,7 @@ export default {
|
||||
this.$router.push('/')
|
||||
},
|
||||
opcionMenu(path) {
|
||||
this.validarLocalStorage()
|
||||
this.open = false
|
||||
this.$router.push(path)
|
||||
},
|
||||
@ -409,16 +410,13 @@ export default {
|
||||
(this.operador.tipoUsuario.id_tipo_usuario != 2 &&
|
||||
!this.operador.institucion)
|
||||
)
|
||||
this.$router.push('/')
|
||||
this.cerrarSesion()
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.validarLocalStorage()
|
||||
this.idTipoUsuario = this.operador.tipoUsuario.id_tipo_usuario
|
||||
},
|
||||
updated() {
|
||||
this.validarLocalStorage()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -7,36 +7,38 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Login from '@/components/admin/Login.vue'
|
||||
import Login from '@/components/admin/Login'
|
||||
|
||||
export default {
|
||||
components: { Login },
|
||||
data() {
|
||||
return {
|
||||
// admin: '',
|
||||
isLoading: false,
|
||||
}
|
||||
return { isLoading: false }
|
||||
},
|
||||
methods: {
|
||||
updateIsLoading(booleanValue) {
|
||||
this.isLoading = booleanValue
|
||||
},
|
||||
// localStorageData() {
|
||||
// this.admin.idUsuario = Number(localStorage.getItem('idUsuario'))
|
||||
// this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario'))
|
||||
// this.admin.tipoUsuario = localStorage.getItem('tipoUsuario')
|
||||
// this.admin.token = {
|
||||
// headers: {
|
||||
// token: localStorage.getItem('token'),
|
||||
// },
|
||||
// }
|
||||
// },
|
||||
},
|
||||
created() {
|
||||
// this.localStorageData()
|
||||
// if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable')
|
||||
// if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno')
|
||||
// if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial')
|
||||
const operador = JSON.parse(localStorage.getItem('operador'))
|
||||
const token = localStorage.getItem('token')
|
||||
|
||||
if (
|
||||
token &&
|
||||
operador &&
|
||||
operador.id_operador &&
|
||||
operador.tipoUsuario.id_tipo_usuario &&
|
||||
operador.id_operador &&
|
||||
((operador.tipoUsuario.id_tipo_usuario === 2 && !operador.institucion) ||
|
||||
(operador.tipoUsuario.id_tipo_usuario != 2 &&
|
||||
operador.institucion.id_institucion))
|
||||
) {
|
||||
if (operador.tipoUsuario.id_tipo_usuario === 2)
|
||||
this.$router.push(
|
||||
'/admin/configuracion/instituciones/buscar_institucion'
|
||||
)
|
||||
else this.$router.push('/prestamo_devolucion')
|
||||
} else localStorage.clear()
|
||||
},
|
||||
layout: 'login',
|
||||
}
|
||||
|
@ -12,31 +12,33 @@ import Login from '@/components/Login'
|
||||
export default {
|
||||
components: { Login },
|
||||
data() {
|
||||
return {
|
||||
// admin: '',
|
||||
isLoading: false,
|
||||
}
|
||||
return { isLoading: false }
|
||||
},
|
||||
methods: {
|
||||
updateIsLoading(booleanValue) {
|
||||
this.isLoading = booleanValue
|
||||
},
|
||||
// localStorageData() {
|
||||
// this.admin.idUsuario = Number(localStorage.getItem('idUsuario'))
|
||||
// this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario'))
|
||||
// this.admin.tipoUsuario = localStorage.getItem('tipoUsuario')
|
||||
// this.admin.token = {
|
||||
// headers: {
|
||||
// token: localStorage.getItem('token'),
|
||||
// },
|
||||
// }
|
||||
// },
|
||||
},
|
||||
created() {
|
||||
// this.localStorageData()
|
||||
// if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable')
|
||||
// if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno')
|
||||
// if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial')
|
||||
const operador = JSON.parse(localStorage.getItem('operador'))
|
||||
const token = localStorage.getItem('token')
|
||||
|
||||
if (
|
||||
token &&
|
||||
operador &&
|
||||
operador.id_operador &&
|
||||
operador.tipoUsuario.id_tipo_usuario &&
|
||||
operador.id_operador &&
|
||||
((operador.tipoUsuario.id_tipo_usuario === 2 && !operador.institucion) ||
|
||||
(operador.tipoUsuario.id_tipo_usuario != 2 &&
|
||||
operador.institucion.id_institucion))
|
||||
) {
|
||||
if (operador.tipoUsuario.id_tipo_usuario === 2)
|
||||
this.$router.push(
|
||||
'/admin/configuracion/instituciones/buscar_institucion'
|
||||
)
|
||||
else this.$router.push('/prestamo_devolucion')
|
||||
} else localStorage.clear()
|
||||
},
|
||||
layout: 'login',
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user