增加登录日志功能

This commit is contained in:
2026-08-26 15:01:35 +08:00
parent a4f7a97763
commit e60cd00395
9 changed files with 1008 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
-- 登录日志表
CREATE TABLE IF NOT EXISTS `yz_system_login_log` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`tid` bigint(20) unsigned DEFAULT NULL COMMENT '租户ID',
`user_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
`account` varchar(64) NOT NULL DEFAULT '' COMMENT '登录账号',
`user_name` varchar(64) NOT NULL DEFAULT '' COMMENT '用户姓名',
`tenant_name` varchar(64) NOT NULL DEFAULT '' COMMENT '租户名称',
`login_type` varchar(20) NOT NULL DEFAULT 'password' COMMENT '登录方式: password-密码, sms-短信验证码, email-邮箱验证码',
`status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '登录状态: 0-失败, 1-成功',
`message` varchar(255) NOT NULL DEFAULT '' COMMENT '结果信息/失败原因',
`ip` varchar(50) NOT NULL DEFAULT '' COMMENT '登录IP',
`user_agent` varchar(500) NOT NULL DEFAULT '' COMMENT '浏览器User-Agent',
`create_time` datetime DEFAULT NULL COMMENT '登录时间',
`delete_time` datetime DEFAULT NULL COMMENT '删除时间',
PRIMARY KEY (`id`),
KEY `idx_tid` (`tid`),
KEY `idx_account` (`account`),
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统登录日志表';