diff --git a/nuxt.config.js b/nuxt.config.js index 2b20982..2334e65 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -23,13 +23,9 @@ export default { modules: ['nuxt-buefy', '@nuxtjs/axios'], axios: {}, build: {}, - /* Server de pruebas */ - // static: { - // prefix: false, - // }, env: { - // api: "http://localhost:3000", - api: 'https://venus.acatlan.unam.mx/ss-pruebas', + api: "http://localhost:3000", + // api: 'https://venus.acatlan.unam.mx/ss-pruebas', // api: "https://890af9d598a4.ngrok.io" // api: "https://venus.acatlan.unam.mx/serviciosocial", }, diff --git a/package-lock.json b/package-lock.json index bf55083..fd1675d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2159,7 +2159,6 @@ "merge-source-map": "^1.1.0", "postcss": "^7.0.14", "postcss-selector-parser": "^6.0.2", - "prettier": "^1.18.2", "source-map": "~0.6.1", "vue-template-es2015-compiler": "^1.9.0" }, @@ -3360,7 +3359,6 @@ "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.3.1", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", @@ -11376,8 +11374,7 @@ "dependencies": { "chokidar": "^3.4.1", "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0", - "watchpack-chokidar2": "^2.0.1" + "neo-async": "^2.5.0" }, "optionalDependencies": { "watchpack-chokidar2": "^2.0.1" diff --git a/pages/admin/index.vue b/pages/admin/index.vue index 9d09c94..75c244b 100644 --- a/pages/admin/index.vue +++ b/pages/admin/index.vue @@ -25,12 +25,82 @@ export default { components: { InputTableA, }, - beforeCreate() { - const idTipoUsuario = Number(localStorage.getItem('idTipoUsuario')) - - if (idTipoUsuario === 2) this.$router.push('/responsable') - if (idTipoUsuario === 3) this.$router.push('/alumno') - if (idTipoUsuario === 4) this.$router.push('/casoEspecial') + data() { + return { + admin: {}, + } + }, + methods: { + imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-danger', + title, + message: err.message, + confirmText: 'Entendido', + hasIcon: true, + iconPack: 'mdi', + icon: 'alert-octagon', + onConfirm, + }) + if (err.err && err.err === 'token error') { + localStorage.clear() + this.$router.push('/') + } + }, + imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-success', + title, + message, + confirmText: 'Ok', + hasIcon: true, + iconPack: 'mdi', + icon: 'check-circle', + onConfirm, + }) + }, + imprimirWarning( + message, + title = '¡Espera un minuto!', + onConfirm = () => {}, + onCancel = () => {} + ) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-warning', + title, + message, + confirmText: 'Confirmar', + canCancel: true, + cancelText: 'Cancelar', + hasIcon: true, + iconPack: 'mdi', + icon: 'help-circle', + onConfirm, + onCancel, + }) + }, + getLocalhostInfo() { + 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.getLocalhostInfo() + 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') }, }