Exemplo n.º 1
0
        public void LoginFail(string loginName, string passWord)
        {
            var loginFail = new Log_LoginFail
            {
                BrowserInfo     = JsonConvert.SerializeObject(HttpContext.Request.Browser),
                ClientIpAddress = IpAddressHelper.GetIP(),
                ClientName      = HttpContext.Request.UserHostName,
                CreateTime      = DateTime.Now,
                LoginName       = loginName,
                Password        = passWord
            };

            db.Log_LoginFail.Add(loginFail);
            db.SaveChanges();
        }
Exemplo n.º 2
0
        //private async Task SignInAsync(User_Info user, bool isPersistent)
        //{
        //    AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie);
        //    var identity = await db.User_Infos.Create(user, DefaultAuthenticationTypes.ApplicationCookie);
        //    AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity);
        //}
        public void LoginSuccess(string loginName, string UserId, int tenantId)
        {
            var loginSuccess = new Log_LoginSuccess
            {
                BrowserInfo     = JsonConvert.SerializeObject(HttpContext.Request.Browser),
                ClientIpAddress = IpAddressHelper.GetIP(),
                ClientName      = HttpContext.Request.UserHostName,
                CreateBy        = UserId,
                CreateTime      = DateTime.Now,
                LoginName       = loginName,
                TenantId        = tenantId
            };

            db.Log_LoginSuccess.Add(loginSuccess);
            db.SaveChanges();
        }