add register

This commit is contained in:
ljw committed 2024-10-31 15:14:30 +08:00
1 parent 0ed40318cb
commit e2fda47cbb
12 files changed
+86 -3

No files matched your search

+10
View File
@@ -323,3 +323,13 @@ func (us *UserService) FindLatestUserIdFromLoginLogByUuid(uuid string) uint {
global.DB.Where("uuid = ?", uuid).Order("id desc").First(llog)
return llog.UserId
}
func (us *UserService) Register(username string, password string) *model.User {
u := &model.User{
Username: username,
Password: us.EncryptPassword(password),
GroupId: 1,
}
global.DB.Create(u)
return u
}