Merge branch 'AddLogin' of danielGe/hackFront into master

This commit was merged in pull request #2.
This commit is contained in:
2020-08-03 04:56:04 +00:00
committed by Gitea
19 changed files with 238 additions and 242 deletions
+1
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
+1 -3
View File
@@ -1,3 +1 @@
<!DOCTYPE html><html lang=en><head><link href=css/app.bf7d8eae.css rel=preload as=style><link href=css/chunk-vendors.cbc2a074.css rel=preload as=style><link href=js/app.f1acd640.js rel=preload as=script><link href=js/chunk-vendors.ee992228.js rel=preload as=script><link href=css/chunk-vendors.cbc2a074.css rel=stylesheet><link href=css/app.bf7d8eae.css rel=stylesheet></head><head><meta name=viewport content="width=device-width,initial-scale=1"><meta charset=utf-8><link rel=stylesheet href=https://unpkg.com/purecss@1.0.0/build/pure-min.css integrity=sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w crossorigin=anonymous><!--[if lte IE 8]> <!DOCTYPE html><html lang=en><head><link href=css/app.67c8f551.css rel=preload as=style><link href=css/chunk-vendors.cbc2a074.css rel=preload as=style><link href=js/app.99c2d4d1.js rel=preload as=script><link href=js/chunk-vendors.5b53642e.js rel=preload as=script><link href=css/chunk-vendors.cbc2a074.css rel=stylesheet><link href=css/app.67c8f551.css rel=stylesheet></head><head><meta name=viewport content="width=device-width,initial-scale=1"><meta charset=utf-8><link rel=stylesheet href=https://unpkg.com/purecss@1.0.0/build/pure-min.css integrity=sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w crossorigin=anonymous><link rel=stylesheet href=https://unpkg.com/purecss@1.0.0/build/grids-responsive-min.css><link rel=stylesheet href=https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css><link rel=stylesheet type=text/css href=style.css media=screen><link rel=stylesheet href=https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css integrity=sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB crossorigin=anonymous><title>HACKATHON REGISTRO</title><link rel="shortcut icon" href=img/icono.png><body><noscript><strong>We're sorry but hack_unam doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.5b53642e.js></script><script src=js/app.99c2d4d1.js></script></body></head></html>
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/grids-responsive-old-ie-min.css">
<![endif]--><!--[if gt IE 8]><!--><link rel=stylesheet href=https://unpkg.com/purecss@1.0.0/build/grids-responsive-min.css><!--<![endif]--><link rel=stylesheet type=text/css href=style.css media=screen><link rel=stylesheet href=https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css integrity=sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB crossorigin=anonymous><title>HACKATHON REGISTRO</title><link rel="shortcut icon" href=img/icono.png><body><noscript><strong>We're sorry but hack_unam doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.ee992228.js></script><script src=js/app.f1acd640.js></script></body></head></html>
+2
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
-2
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+9 -3
View File
@@ -1,10 +1,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous"> <link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css"
integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/grids-responsive-min.css"> <link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/grids-responsive-min.css">
@@ -15,14 +17,18 @@
<link rel="stylesheet" type="text/css" href="style.css" media="screen"> <link rel="stylesheet" type="text/css" href="style.css" media="screen">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"
integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<title>HACKATHON REGISTRO</title> <title>HACKATHON REGISTRO</title>
<link rel="shortcut icon" href="img/icono.png"> <link rel="shortcut icon" href="img/icono.png">
<body> <body>
<noscript> <noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html> </html>
+1 -5
View File
@@ -1,9 +1,7 @@
<template> <template>
<div id="app"> <div id="app">
<router-view></router-view> <router-view></router-view>
</div> </div>
</template> </template>
<script> <script>
@@ -17,14 +15,12 @@ Vue.use(IconsPlugin);
export default { export default {
name: "App", name: "App",
}; };
</script> </script>
<style> <style>
#app { #app {
font-family: 'Avenir', Helvetica, Arial, sans-serif; font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
text-align: center; text-align: center;
+9 -9
View File
@@ -227,7 +227,7 @@ export default {
noIntegrantes: 1, noIntegrantes: 1,
integrantes: [], integrantes: [],
cargando: false, cargando: false,
confirmacion: false confirmacion: false,
}; };
}, },
methods: { methods: {
@@ -246,7 +246,7 @@ export default {
nombre: "", nombre: "",
apellidoPa: "", apellidoPa: "",
apellidoMa: "", apellidoMa: "",
correo: "" correo: "",
}); });
} }
}, },
@@ -303,8 +303,8 @@ export default {
showCancelButton: true, showCancelButton: true,
confirmButtonColor: "#3085d6", confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33", cancelButtonColor: "#d33",
confirmButtonText: "Si" confirmButtonText: "Si",
}).then(result => { }).then((result) => {
if (result.value) { if (result.value) {
window.location.href = window.location.href =
"https://www.acatlan.unam.mx/hackaton/index.html#head"; "https://www.acatlan.unam.mx/hackaton/index.html#head";
@@ -323,18 +323,18 @@ export default {
apellidoMaLider: this.apellidoMaLider, apellidoMaLider: this.apellidoMaLider,
correoLider: this.correoLider, correoLider: this.correoLider,
carreraLider: this.carrera, carreraLider: this.carrera,
integrantes: this.integrantes integrantes: this.integrantes,
}; };
axios axios
.post(`${config.api}/registro`, data) .post(`${config.api}/registro`, data)
.then(async respose => { .then(async (respose) => {
this.cargando = false; this.cargando = false;
console.log(respose.data.msj); console.log(respose.data.msj);
await Swal.fire("Has sido registrado", "", "success"); await Swal.fire("Has sido registrado", "", "success");
window.location.href = window.location.href =
"https://www.acatlan.unam.mx/hackaton/index.html#head"; "https://www.acatlan.unam.mx/hackaton/index.html#head";
}) })
.catch(async error => { .catch(async (error) => {
this.cargando = false; this.cargando = false;
console.log(error.response.data.msj); console.log(error.response.data.msj);
await Swal.fire( await Swal.fire(
@@ -343,8 +343,8 @@ export default {
"error" "error"
).then((window.location.href = "#")); ).then((window.location.href = "#"));
}); });
} },
} },
}; };
</script> </script>
+58 -54
View File
@@ -6,106 +6,108 @@
<h1>Hackaton UNAM-AWS</h1> <h1>Hackaton UNAM-AWS</h1>
<div class="conteiner "> <div class="conteiner ">
<div class="admin-campos"> <div class="admin-campos">
<i class="fa fa-user"></i> <i class="fa fa-user"></i>
<input type="email" placeholder="Usuario" v-model="usuario" @keyup.enter="entrar()"> <input
type="email"
placeholder="Usuario"
v-model="usuario"
@keyup.enter="entrar()"
/>
</div> </div>
<div class="admin-campos"> <div class="admin-campos">
<i class="fa fa-lock"></i> <i class="fa fa-lock"></i>
<input type="password" placeholder="Contraseña" v-model="password" @keyup.enter="entrar()"> <input
type="password"
placeholder="Contraseña"
v-model="password"
@keyup.enter="entrar()"
/>
</div> </div>
<div class="entrar"> <div class="entrar">
<button
<button class="button" id="boton_entrar" v-if="validar_ambos()" @click="entrar()">Entrar</button> class="button"
id="boton_entrar"
v-if="validar_ambos()"
@click="entrar()"
>
Entrar
</button>
<p class="botton_falso" v-else>Entrar</p> <p class="botton_falso" v-else>Entrar</p>
</div> </div>
</div> </div>
<!--Importar componente de footer para login en esta ocacion yo no lo ocuper por eso esta comentado --> <!--Importar componente de footer para login en esta ocacion yo no lo ocuper por eso esta comentado -->
<!-- <Footer /> --> <!-- <Footer /> -->
</div> </div>
</section> </section>
</template> </template>
<script> <script>
import axios from 'axios'; import axios from "axios";
import config from '../config/config.js' import config from "../config/config.js";
import swal from 'sweetalert'; import swal from "sweetalert";
import Header from "./../view/headerAdmin.vue"; import Header from "./../view/headerAdmin.vue";
export default { export default {
components: { components: {
//HelloWorld //HelloWorld
Header Header,
}, },
data() { data() {
return { return {
usuario: '', usuario: "",
password: '', password: "",
error: false, error: false,
mal: null, mal: null,
resp: null resp: null,
} };
}, },
methods: methods: {
{
malo() { malo() {
return this.error; return this.error;
}, },
validar_ambos() validar_ambos() {
{ if (this.usuario != "" && this.password != "") return true;
if(this.usuario!='' && this.password!='') else return false;
return true;
else
return false;
}, },
entrar() { entrar() {
const data = { const data = {
usuario: this.usuario, usuario: this.usuario,
password: this.password, password: this.password,
} };
axios.post(`${config.api}/login`,data).then(async respose=>{
axios
.post(`${config.api}/login`, data)
.then(async (respose) => {
this.resp = respose.data; this.resp = respose.data;
if(respose.data.err==false) if (respose.data.err == false) {
{
await swal(`Bienvenido ${this.usuario}`, "", "success"); await swal(`Bienvenido ${this.usuario}`, "", "success");
window.localStorage.setItem('id_usuario', respose.data.id_usuario); window.localStorage.setItem("id_usuario", respose.data.id_usuario);
this.$router.push('/'); this.$router.push("/");
} } else {
else{
this.error = true; this.error = true;
await swal(" Usuario o Contraseña incorrecta.", "", "error"); await swal(" Usuario o Contraseña incorrecta.", "", "error");
} }
}).catch(err=>{ })
.catch((err) => {
swal(" Usuario o Contraseña incorrecta.", "", "error"); swal(" Usuario o Contraseña incorrecta.", "", "error");
this.resp = err; this.resp = err;
this.error = true; this.error = true;
});
},
}) },
} beforeCreate() {
}
,beforeCreate () {
localStorage.clear(); localStorage.clear();
} },
} };
</script> </script>
<style scoped> <style scoped>
.button { .button {
background-color: #1B3D70; /* Green */ background-color: #1b3d70; /* Green */
border: none; border: none;
color: white; color: white;
padding: 1rem 7rem; padding: 1rem 7rem;
@@ -123,7 +125,7 @@ export default {
} }
.botton_falso { .botton_falso {
background-color: #CCC; /* Green */ background-color: #ccc; /* Green */
border: none; border: none;
color: white; color: white;
padding: 1rem 7rem; padding: 1rem 7rem;
@@ -147,7 +149,6 @@ h1{
margin-top: 2.5rem; margin-top: 2.5rem;
margin-bottom: 3.5rem; margin-bottom: 3.5rem;
font-size: 1.5rem; font-size: 1.5rem;
} }
.admin-campos { .admin-campos {
@@ -156,8 +157,9 @@ h1{
position: relative; position: relative;
} }
.admin-campos input[type="email"], .admin-campos input[type="password"] { .admin-campos input[type="email"],
border-bottom: black .2rem solid; .admin-campos input[type="password"] {
border-bottom: black 0.2rem solid;
border-left: white; border-left: white;
border-right: white; border-right: white;
border-top: white; border-top: white;
@@ -168,7 +170,8 @@ h1{
width: 85%; width: 85%;
} }
.admin-campos input::placeholder, .admin-campos input::placeholder { .admin-campos input::placeholder,
.admin-campos input::placeholder {
color: rgb(75, 71, 71); color: rgb(75, 71, 71);
} }
@@ -177,7 +180,7 @@ h1{
font-size: 1.5rem; font-size: 1.5rem;
left: 1.75rem; left: 1.75rem;
position: absolute; position: absolute;
top: .75rem; top: 0.75rem;
} }
.entrar { .entrar {
@@ -200,7 +203,8 @@ h1{
width: 40rem; width: 40rem;
} }
.admin-campos input[type="email"], .admin-campos input[type="password"] { .admin-campos input[type="email"],
.admin-campos input[type="password"] {
font-size: 1.5rem; font-size: 1.5rem;
padding: 1rem 0 1rem 4rem; padding: 1rem 0 1rem 4rem;
} }
+3 -5
View File
@@ -16,12 +16,10 @@ export default {
//HelloWorld //HelloWorld
Header, Header,
Form, Form,
Footer Footer,
} },
}; };
</script> </script>
<!-- Add "scoped" attribute to limit CSS to this component only --> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped> <style scoped></style>
</style>
+2 -2
View File
@@ -1,5 +1,5 @@
const config = { const config = {
api: "http://localhost:3000" //api: "http://localhost:3000",
//api: "https://venus.acatlan.unam.mx/hackaton" api: "https://venus.acatlan.unam.mx/hackaton"
}; };
module.exports = config; module.exports = config;
+3 -3
View File
@@ -14,11 +14,11 @@ Vue.use(BootstrapVue);
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(VueRouter); Vue.use(VueRouter);
const router = new VueRouter({ const router = new VueRouter({
routes routes,
}); });
new Vue({ new Vue({
el: "#app", el: "#app",
render: h => h(App), render: (h) => h(App),
router router,
}); });
-1
View File
@@ -3,5 +3,4 @@ import Login from "./components/login.vue";
export const routes = [ export const routes = [
{ path: "/", component: Form, name: "form" }, { path: "/", component: Form, name: "form" },
{ path: "/panelAdmin", component: Login, name: "Login" }, { path: "/panelAdmin", component: Login, name: "Login" },
]; ];
-5
View File
@@ -11,7 +11,6 @@
</div> </div>
<!-- div banner --> <!-- div banner -->
</div> </div>
</template> </template>
@@ -20,8 +19,6 @@ export default {};
</script> </script>
<style> <style>
.header { .header {
width: 100%; width: 100%;
max-height: 260px; max-height: 260px;
@@ -52,7 +49,6 @@ export default {};
margin-left: auto; margin-left: auto;
} }
@media screen and (max-width: 767px) { @media screen and (max-width: 767px) {
.footer img { .footer img {
width: 40px !important; width: 40px !important;
@@ -62,5 +58,4 @@ export default {};
font-size: 12px !important; font-size: 12px !important;
} }
} }
</style> </style>