mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2025-12-03 02:23:16 +00:00
add register
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user