wip: 结构感觉还是要调整

This commit is contained in:
loveuer
2024-11-04 22:04:00 +08:00
parent 0fabeb69d6
commit 48e8d96726
4 changed files with 122 additions and 6 deletions

View File

@ -24,6 +24,7 @@ func New(opts ...Option) (*Urbac, error) {
rootPrivilege *model.Privilege
rootRole *model.Role
rootScope *model.Scope
rootUser *model.User
)
for _, opt := range opts {
@ -60,5 +61,15 @@ func New(opts ...Option) (*Urbac, error) {
}
}
rootUser = &model.User{
Username: "admin",
Password: tool.NewPassword("123456"),
Status: model.StatusActive,
Nickname: "管理员",
RoleNames: []string{"admin"},
}
u.newUser()
return u, nil
}