This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-11-09 09:50:39 -07:00
parent 5c68141877
commit 44c5f1df9a
4 changed files with 14 additions and 37 deletions

View File

@@ -5551,7 +5551,7 @@ Public Class ClsContabilidad
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@TipoCambio", SqlDbType.Int).Value = TipoCambio
.Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico
.Add("@Cuenta", SqlDbType.NVarChar).Value = Cuenta
'.Add("@Cuenta", SqlDbType.NVarChar).Value = Cuenta
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -10,18 +10,25 @@ Imports System.IO
Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
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 = "text/json"
Dim origin As String = context.Request.UrlReferrer.ToString()
context.Response.AddHeader("Access-Control-Allow-Origin", origin.Substring(0, origin.Length - 1))
If context.Request IsNot Nothing AndAlso context.Request.UrlReferrer IsNot Nothing Then
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-Methods", "GET, POST")
context.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept")
context.Response.AddHeader("Access-Control-Allow-Credentials", "true")
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)
context.Response.Write(json)
context.Response.Flush()

View File

@@ -131,18 +131,7 @@
<script type="text/javascript" src="/Metronic/assets/global/scripts/JSNoCustom"></script>
<%--<script type="text/javascript" src="/Scripts/Notificaciones.js"></script>--%>
<script>
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);
function opennewlocation(returnurl,token) {
document.location = returnurl;
}
// aqui debe de llammarse siganalr, para desconectar

View File

@@ -250,26 +250,7 @@ Partial Class LogIn
Dim cookie = FormsAuthentication.GetAuthCookie(Usuario.CveUsuario, False)
Response.Cookies.Add(cookie)
'RegistraScript(String.Format("iniciaSesion('{0}')", ReturnUrl.Replace("'", "\'")))
'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)))
RegistraScript(String.Format("opennewlocation('{0}','{1}')", ReturnUrl, ""))
'Response.Redirect(ReturnUrl, True)
Else
Alert("El usuario no esta autorizado en este equipo, favor de contactar al administrador de usuarios.", TipoMensaje.MsgAdvertencia)