Skip to content

Commit

Permalink
fix: 修复更新用户的逻辑bug (eryajf#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
eryajf committed Nov 15, 2023
1 parent 5343539 commit d00d6df
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions logic/user_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,23 +217,21 @@ func (l UserLogic) Update(c *gin.Context, req interface{}) (data interface{}, rs
return nil, tools.NewMySqlError(err)
}

// 过滤掉前端会选择到的 请选择部门信息 这个选项
var (
depts string
deptids []uint
)
if strings.Contains(r.Departments, "请选择部门信息") {
for _, v := range strings.Split(r.Departments, ",") {
if v != "请选择部门信息" {
depts += v + ","
}
for _, v := range strings.Split(r.Departments, ",") {
if v != "请选择部门信息" {
depts += v + ","
}
for _, j := range r.DepartmentId {
if j != 0 {
deptids = append(deptids, j)
}
}
for _, j := range r.DepartmentId {
if j != 0 {
deptids = append(deptids, j)
}
}
// fmt.Println(depts, deptids)

// 拼装新的用户信息
user := model.User{
Expand Down

0 comments on commit d00d6df

Please sign in to comment.