mirror of
https://github.com/skyle1995/NetworkAuth.git
synced 2026-05-25 02:24:05 +08:00
调整日志和鉴权接管方案
This commit is contained in:
@@ -24,8 +24,8 @@ const (
|
||||
APITypeSingleLogin = 10 // 卡密登录
|
||||
|
||||
// 账号管理
|
||||
APITypeUserLogin = 20 // 用户登录
|
||||
APITypeUserRegin = 21 // 用户注册
|
||||
APITypeUserLogin = 20 // 字系统登录
|
||||
APITypeUserRegin = 21 // 字系统注册
|
||||
APITypeUserRecharge = 22 // 用户充值
|
||||
|
||||
// 登出操作
|
||||
@@ -188,8 +188,8 @@ func GetAPITypes(categorized bool) interface{} {
|
||||
{
|
||||
Name: "账号管理",
|
||||
Types: []APITypeInfo{
|
||||
{Type: APITypeUserLogin, Name: "用户登录"},
|
||||
{Type: APITypeUserRegin, Name: "用户注册"},
|
||||
{Type: APITypeUserLogin, Name: "子系统登录"},
|
||||
{Type: APITypeUserRegin, Name: "子系统注册"},
|
||||
{Type: APITypeUserRecharge, Name: "用户充值"},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
type LoginLog struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
Type string `gorm:"type:varchar(20);index;comment:日志类型(admin/user)" json:"type"`
|
||||
UUID string `gorm:"type:char(36);index;comment:用户UUID" json:"uuid"`
|
||||
Username string `gorm:"type:varchar(100);index;comment:登录用户名" json:"username"`
|
||||
IP string `gorm:"type:varchar(50);comment:登录IP" json:"ip"`
|
||||
Status int `gorm:"type:tinyint;comment:登录状态 1:成功 0:失败" json:"status"`
|
||||
|
||||
@@ -22,7 +22,7 @@ type User struct {
|
||||
Password string `gorm:"size:255;not null;comment:密码哈希值"`
|
||||
PasswordSalt string `gorm:"size:64;not null;comment:密码加密盐值"`
|
||||
Status int `gorm:"not null;default:1;comment:状态:0禁用,1启用" json:"status"`
|
||||
Role int `gorm:"not null;default:2;comment:角色类型:0超级管理员,1代理成员,2普通成员" json:"role"`
|
||||
Role int `gorm:"not null;default:2;comment:角色类型:0超级管理员,1管理员,2子账号" json:"role"`
|
||||
Permissions string `gorm:"size:255;comment:权限列表,逗号分隔" json:"permissions"`
|
||||
Nickname string `gorm:"size:64;comment:用户昵称" json:"nickname"`
|
||||
Remark string `gorm:"size:255;comment:备注信息" json:"remark"`
|
||||
|
||||
Reference in New Issue
Block a user