Cracion de login

This commit is contained in:
2022-11-04 09:08:50 -05:00
parent 06f25d4726
commit 2085ff40f0
2064 changed files with 788633 additions and 13 deletions

View File

@@ -20,6 +20,34 @@ controlador.verVentasJson = (req, res) => {
};
//********* LOGIN APP ********//
controlador.app_login = (req, res) => {
res.render('login');
};
controlador.auth = (req, res) => {
console.log(req.body);
req.getConnection((err, conn) => {
conn.query(`SELECT * FROM usuarios WHERE n_sesion = ?`,[req.body.usuario],(err,rows)=>{
if(err){
//res.json(err);
res.json("No Autorizado");
}else{
try{
if(rows.length>0){
//res.json({sision:"exitosa"});
console.log(rows);
res.render('panel_control');
}
}catch(e){
res.render('login.ejs');
next();
}
}
});
});
//res.render('');
};
//********* APP-SIGMA ********//
controlador.app_sigma = (req, res) => {
res.render('app_pedidos');