fix: 修复更新用户的逻辑bug (#282)

This commit is contained in:
二丫讲梵 2023-11-15 23:32:51 +08:00 committed by GitHub
parent 5343539efe
commit d00d6df8a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 11 deletions

View File

@ -217,11 +217,11 @@ 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 + ","
@ -232,8 +232,6 @@ func (l UserLogic) Update(c *gin.Context, req interface{}) (data interface{}, rs
deptids = append(deptids, j)
}
}
}
// fmt.Println(depts, deptids)
// 拼装新的用户信息
user := model.User{