🎨 新增用户登录日志记录

This commit is contained in:
2025-09-08 01:48:36 +08:00
parent df46c7ab29
commit a65266d033
8 changed files with 140 additions and 0 deletions

22
model/user/login_log.go Normal file
View File

@@ -0,0 +1,22 @@
package user
import "git.echol.cn/loser/lckt/global"
type LoginLog struct {
global.GVA_MODEL
UserId uint `json:"user_id" gorm:"comment:用户ID;index"`
UserName string `json:"user_name" gorm:"comment:用户登录名"`
Phone string `json:"phone" gorm:"comment:用户手机号"`
Ip string `json:"ip" gorm:"comment:登录IP"`
Address string `json:"address" gorm:"comment:登录地址"`
UserAgent string `json:"user_agent" gorm:"comment:用户代理"`
// 登录设备
Device string `json:"device" gorm:"comment:登录设备"`
// 登录方式
Mode string `json:"mode" gorm:"comment:登录方式"`
LoginTime string `json:"login_time" gorm:"comment:登录时间"`
}
func (LoginLog) TableName() string {
return "user_login_log"
}

View File

@@ -43,6 +43,7 @@ type BindPhoneReq struct {
type GetUserListReq struct {
request.PageInfo
UserId uint `json:"user_id" form:"user_id"`
Type int `json:"type" form:"type"`
UserLabel string `json:"user_label" form:"user_label" `
Status int `json:"status" form:"status"`