bugfix: add user.Type (#667)

This commit is contained in:
yubo 2021-04-26 19:15:33 +08:00 committed by GitHub
parent a11813f4b2
commit f40332f197
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -59,7 +59,7 @@ type userProfileForm struct {
Im string `json:"im"` Im string `json:"im"`
IsRoot int `json:"is_root"` IsRoot int `json:"is_root"`
LeaderId int64 `json:"leader_id"` LeaderId int64 `json:"leader_id"`
Typ int `json:"typ"` Type int `json:"type"`
Status int `json:"status"` Status int `json:"status"`
Organization string `json:"organization"` Organization string `json:"organization"`
} }
@ -86,6 +86,7 @@ func userAddPost(c *gin.Context) {
Im: f.Im, Im: f.Im,
IsRoot: f.IsRoot, IsRoot: f.IsRoot,
LeaderId: f.LeaderId, LeaderId: f.LeaderId,
Type: f.Type,
Organization: f.Organization, Organization: f.Organization,
UpdatedAt: now, UpdatedAt: now,
UUID: models.GenUUIDForUser(f.Username), UUID: models.GenUUIDForUser(f.Username),
@ -157,13 +158,13 @@ func userProfilePut(c *gin.Context) {
target.IsRoot = f.IsRoot target.IsRoot = f.IsRoot
} }
if f.Typ != target.Type { if f.Type != target.Type {
arr = append(arr, fmt.Sprintf("typ: %d -> %d", target.Type, f.Typ)) arr = append(arr, fmt.Sprintf("type: %d -> %d", target.Type, f.Type))
target.Type = f.Typ target.Type = f.Type
} }
if f.Status != target.Status { if f.Status != target.Status {
arr = append(arr, fmt.Sprintf("typ: %d -> %d", target.Status, f.Status)) arr = append(arr, fmt.Sprintf("status: %d -> %d", target.Status, f.Status))
target.Status = f.Status target.Status = f.Status
if target.Status == models.USER_S_ACTIVE { if target.Status == models.USER_S_ACTIVE {
target.LoginErrNum = 0 target.LoginErrNum = 0