mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2026-01-30 02:43:51 +00:00
fix: Email of Register
This commit is contained in:
@@ -391,7 +391,7 @@ func (ct *User) Register(c *gin.Context) {
|
||||
response.Fail(c, 101, errList[0])
|
||||
return
|
||||
}
|
||||
u := service.AllService.UserService.Register(f.Username, f.Password)
|
||||
u := service.AllService.UserService.Register(f.Username, f.Email, f.Password)
|
||||
if u == nil || u.Id == 0 {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "OperationFailed"))
|
||||
return
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
"strings"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type UserService struct {
|
||||
@@ -378,9 +377,10 @@ func (us *UserService) IsPasswordEmptyByUser(u *model.User) bool {
|
||||
}
|
||||
|
||||
// Register 注册
|
||||
func (us *UserService) Register(username string, password string) *model.User {
|
||||
func (us *UserService) Register(username string, email string, password string) *model.User {
|
||||
u := &model.User{
|
||||
Username: username,
|
||||
Email: email,
|
||||
Password: us.EncryptPassword(password),
|
||||
GroupId: 1,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user