Merge branch 'master' of http://oirigoyen@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -10,18 +10,25 @@ Imports System.IO
|
|||||||
Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||||
|
|
||||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||||
If context.Request("metodo").ToString() = "GetTokenAngular" Then
|
If context.Request("metodo") IsNot Nothing AndAlso context.Request("metodo").ToString() = "GetTokenAngular" Then
|
||||||
'context.Response.ContentType = "application/json; charset=utf-8"
|
'context.Response.ContentType = "application/json; charset=utf-8"
|
||||||
|
|
||||||
context.Response.ContentType = "text/json"
|
context.Response.ContentType = "text/json"
|
||||||
Dim origin As String = context.Request.UrlReferrer.ToString()
|
If context.Request IsNot Nothing AndAlso context.Request.UrlReferrer IsNot Nothing Then
|
||||||
context.Response.AddHeader("Access-Control-Allow-Origin", origin.Substring(0, origin.Length - 1))
|
Dim origin As String = context.Request.UrlReferrer.ToString()
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", origin.Substring(0, origin.Length - 1))
|
||||||
|
End If
|
||||||
'context.Response.AddHeader("Access-Control-Allow-Origin", "http://localhost:4200")
|
'context.Response.AddHeader("Access-Control-Allow-Origin", "http://localhost:4200")
|
||||||
'context.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST")
|
'context.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST")
|
||||||
context.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept")
|
context.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept")
|
||||||
context.Response.AddHeader("Access-Control-Allow-Credentials", "true")
|
context.Response.AddHeader("Access-Control-Allow-Credentials", "true")
|
||||||
context.Response.StatusCode = 200
|
context.Response.StatusCode = 200
|
||||||
Dim key As String = GetTokenAngular(context)
|
Dim key As String = ""
|
||||||
|
Try
|
||||||
|
key = GetTokenAngular(context)
|
||||||
|
Catch ex As Exception
|
||||||
|
GuardaLog(ex.ToString())
|
||||||
|
End Try
|
||||||
Dim json As String = JsonConvert.SerializeObject(key)
|
Dim json As String = JsonConvert.SerializeObject(key)
|
||||||
context.Response.Write(json)
|
context.Response.Write(json)
|
||||||
context.Response.Flush()
|
context.Response.Flush()
|
||||||
|
|||||||
13
LogIn.aspx
13
LogIn.aspx
@@ -131,18 +131,7 @@
|
|||||||
<script type="text/javascript" src="/Metronic/assets/global/scripts/JSNoCustom"></script>
|
<script type="text/javascript" src="/Metronic/assets/global/scripts/JSNoCustom"></script>
|
||||||
<%--<script type="text/javascript" src="/Scripts/Notificaciones.js"></script>--%>
|
<%--<script type="text/javascript" src="/Scripts/Notificaciones.js"></script>--%>
|
||||||
<script>
|
<script>
|
||||||
function opennewlocation(returnurl,token) {
|
function opennewlocation(returnurl,token) {
|
||||||
//let fram = $('#framexd');
|
|
||||||
//let Pagina =
|
|
||||||
// "http://localhost:2536/auth/login?authtoken=" + token;
|
|
||||||
// Metronic.blockUI();
|
|
||||||
//fram.unbind("load");
|
|
||||||
//fram.load(function () {
|
|
||||||
// setTimeout(function () { document.location = returnurl; },1500)
|
|
||||||
// Metronic.unblockUI();
|
|
||||||
//});
|
|
||||||
//fram.prop('src', Pagina);
|
|
||||||
|
|
||||||
document.location = returnurl;
|
document.location = returnurl;
|
||||||
}
|
}
|
||||||
// aqui debe de llammarse siganalr, para desconectar
|
// aqui debe de llammarse siganalr, para desconectar
|
||||||
|
|||||||
@@ -250,26 +250,7 @@ Partial Class LogIn
|
|||||||
|
|
||||||
Dim cookie = FormsAuthentication.GetAuthCookie(Usuario.CveUsuario, False)
|
Dim cookie = FormsAuthentication.GetAuthCookie(Usuario.CveUsuario, False)
|
||||||
Response.Cookies.Add(cookie)
|
Response.Cookies.Add(cookie)
|
||||||
'RegistraScript(String.Format("iniciaSesion('{0}')", ReturnUrl.Replace("'", "\'")))
|
RegistraScript(String.Format("opennewlocation('{0}','{1}')", ReturnUrl, ""))
|
||||||
|
|
||||||
'Public Property CveUsuario As Integer
|
|
||||||
'Public Property Mail As String
|
|
||||||
'Public Property Nombre As String
|
|
||||||
'Public Property Contraseña As String
|
|
||||||
'Public Property CvePerfil As Integer
|
|
||||||
'Public Property CveUsuarioModifico As Integer
|
|
||||||
'Public Property CveEmpresa As Integer
|
|
||||||
'Public Property CveUsuarioRegistro As Integer
|
|
||||||
Dim userm As New UserModel()
|
|
||||||
userm.CveUsuario = Usuario.CveUsuario
|
|
||||||
userm.Mail = Usuario.Usuario
|
|
||||||
userm.Nombre = Usuario.Nombre
|
|
||||||
userm.Contraseña = Usuario.Contraseña
|
|
||||||
userm.CvePerfil = Usuario.CveRol
|
|
||||||
userm.CveEmpresa = 119 'Usuario.CveEmpresa
|
|
||||||
userm.CveUsuarioModifico = Usuario.CveEmpresa
|
|
||||||
userm.CveUsuarioRegistro = Usuario.CveEmpresa
|
|
||||||
RegistraScript(String.Format("opennewlocation('{0}','{1}')", ReturnUrl, GenerateJSONWebToken(userm)))
|
|
||||||
'Response.Redirect(ReturnUrl, True)
|
'Response.Redirect(ReturnUrl, True)
|
||||||
Else
|
Else
|
||||||
Alert("El usuario no esta autorizado en este equipo, favor de contactar al administrador de usuarios.", TipoMensaje.MsgAdvertencia)
|
Alert("El usuario no esta autorizado en este equipo, favor de contactar al administrador de usuarios.", TipoMensaje.MsgAdvertencia)
|
||||||
|
|||||||
Reference in New Issue
Block a user