From 9f3777209c49ba8fd9cd4b29c78d5d019dee88d4 Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Sat, 15 Jan 2022 13:06:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20ILogin=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/LoginService.cs | 22 ++++++------------- .../admin/BootstrapAdmin.Web.Core/ILogin.cs | 9 ++++---- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/LoginService.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/LoginService.cs index a971afd2..f8788b05 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/LoginService.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/LoginService.cs @@ -1,11 +1,6 @@ -using BootstrapAdmin.Web.Core; +using BootstrapAdmin.DataAccess.Models; +using BootstrapAdmin.Web.Core; using PetaPoco; -using BootstrapAdmin.DataAccess.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BootstrapAdmin.DataAccess.PetaPoco.Services; @@ -19,15 +14,14 @@ class LoginService : ILogin /// /// /// - /// /// - /// - /// - /// /// + /// + /// + /// /// /// - public Task Log(string userName, DateTime loginTime, string IP, string address, string? browser, string userAgent, string OS, bool result) + public bool Log(string userName, string? IP, string? OS, string? browser, string? address, string? userAgent, bool result) { var loginUser = new LoginLog() { @@ -40,9 +34,7 @@ class LoginService : ILogin UserAgent = userAgent, Result = result ? "登录成功" : "登录失败" }; - Database.Insert(loginUser); - - return Task.FromResult(true); + return true; } } diff --git a/src/blazor/admin/BootstrapAdmin.Web.Core/ILogin.cs b/src/blazor/admin/BootstrapAdmin.Web.Core/ILogin.cs index 6ed14ad5..fff87c10 100644 --- a/src/blazor/admin/BootstrapAdmin.Web.Core/ILogin.cs +++ b/src/blazor/admin/BootstrapAdmin.Web.Core/ILogin.cs @@ -9,13 +9,12 @@ public interface ILogin /// /// /// - /// /// - /// - /// - /// /// + /// + /// + /// /// /// - Task Log(string userName, DateTime loginTime, string IP, string address, string? browser, string userAgent, string OS, bool result); + bool Log(string userName, string? IP, string? OS, string? browser, string? address, string? userAgent, bool result); }