diff --git a/src/components/login.vue b/src/components/login.vue index 128f281..5a4fe77 100644 --- a/src/components/login.vue +++ b/src/components/login.vue @@ -53,7 +53,7 @@ import Header from "./../view/headerAdmin.vue"; export default { components: { //HelloWorld - Header, + Header }, data() { return { @@ -61,7 +61,7 @@ export default { password: "", error: false, mal: null, - resp: null, + resp: null }; }, methods: { @@ -75,33 +75,33 @@ export default { entrar() { const data = { usuario: this.usuario, - password: this.password, + password: this.password }; axios .post(`${config.api}/login`, data) - .then(async (respose) => { + .then(async respose => { this.resp = respose.data; if (respose.data.err == false) { await swal(`Bienvenido ${this.usuario}`, "", "success"); window.localStorage.setItem("id_usuario", respose.data.id_usuario); - this.$router.push("/"); + this.$router.push("/Registros"); } else { this.error = true; await swal(" Usuario o ContraseƱa incorrecta.", "", "error"); } }) - .catch((err) => { + .catch(err => { swal(" Usuario o ContraseƱa incorrecta.", "", "error"); this.resp = err; this.error = true; }); - }, + } }, beforeCreate() { localStorage.clear(); - }, + } }; diff --git a/src/components/panelAdmin.vue b/src/components/panelAdmin.vue new file mode 100644 index 0000000..b010394 --- /dev/null +++ b/src/components/panelAdmin.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/src/components/usuario.vue b/src/components/usuario.vue index eaa2ad5..49d2ecd 100644 --- a/src/components/usuario.vue +++ b/src/components/usuario.vue @@ -16,8 +16,8 @@ export default { //HelloWorld Header, Form, - Footer, - }, + Footer + } }; diff --git a/src/config/config.js b/src/config/config.js index a63cb0b..17b8ff5 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -1,5 +1,13 @@ const config = { + + //Local //api: "http://localhost:3001" - api: "https://venus.acatlan.unam.mx/indiana_hackaton" + + //Pruebas + api: "https://venus.acatlan.unam.mx/hackaton" + + //Produccion + //api: "https://venus.acatlan.unam.mx/indiana_hackaton" + }; module.exports = config; diff --git a/src/routes.js b/src/routes.js index 8dc9217..66ee665 100644 --- a/src/routes.js +++ b/src/routes.js @@ -1,6 +1,8 @@ import Form from "./components/usuario.vue"; import Login from "./components/login.vue"; +import Panel from "./components/panelAdmin.vue"; export const routes = [ { path: "/", component: Form, name: "form" }, { path: "/panelAdmin", component: Login, name: "Login" }, + { path: "/Registros", component: Panel, name: "Panel" } ];