Add SignupApplication to user.

This commit is contained in:
Yang Luo
2021-06-21 10:22:47 +08:00
parent 64f85fdc6c
commit 9c233e42c0
3 changed files with 49 additions and 46 deletions

View File

@ -135,22 +135,23 @@ func (c *ApiController) Signup() {
}
user := &object.User{
Owner: form.Organization,
Name: username,
CreatedTime: util.GetCurrentTime(),
Id: id,
Type: "normal-user",
Password: form.Password,
DisplayName: form.Name,
Avatar: organization.DefaultAvatar,
Email: form.Email,
Phone: form.Phone,
Address: []string{},
Affiliation: form.Affiliation,
IsAdmin: false,
IsGlobalAdmin: false,
IsForbidden: false,
Properties: map[string]string{},
Owner: form.Organization,
Name: username,
CreatedTime: util.GetCurrentTime(),
Id: id,
Type: "normal-user",
Password: form.Password,
DisplayName: form.Name,
Avatar: organization.DefaultAvatar,
Email: form.Email,
Phone: form.Phone,
Address: []string{},
Affiliation: form.Affiliation,
IsAdmin: false,
IsGlobalAdmin: false,
IsForbidden: false,
SignupApplication: application.Name,
Properties: map[string]string{},
}
affected := object.AddUser(user)

View File

@ -271,19 +271,20 @@ func (c *ApiController) Login() {
properties := map[string]string{}
properties["no"] = strconv.Itoa(len(object.GetUsers(application.Organization)) + 2)
user := &object.User{
Owner: application.Organization,
Name: userInfo.Username,
CreatedTime: util.GetCurrentTime(),
Id: util.GenerateId(),
Type: "normal-user",
DisplayName: userInfo.DisplayName,
Avatar: userInfo.AvatarUrl,
Email: userInfo.Email,
Score: 200,
IsAdmin: false,
IsGlobalAdmin: false,
IsForbidden: false,
Properties: properties,
Owner: application.Organization,
Name: userInfo.Username,
CreatedTime: util.GetCurrentTime(),
Id: util.GenerateId(),
Type: "normal-user",
DisplayName: userInfo.DisplayName,
Avatar: userInfo.AvatarUrl,
Email: userInfo.Email,
Score: 200,
IsAdmin: false,
IsGlobalAdmin: false,
IsForbidden: false,
SignupApplication: application.Name,
Properties: properties,
}
object.AddUser(user)