☄️ fix: 企业微信同步用户之后部门的问题,兼容用户没有手机号同步失败的问题 (#102)

This commit is contained in:
二丫讲梵 2022-08-04 10:16:36 +08:00 committed by GitHub
parent 4b939eec09
commit 47341d108f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -94,6 +94,9 @@ func CommonAddUser(user *model.User, groups []*model.Group) error {
if user.Position == "" {
user.Position = "默认:技术"
}
if user.Mobile == "" {
user.Mobile = "该用户手机号为空"
}
if user.Introduction == "" {
user.Introduction = user.Nickname
}

View File

@ -74,7 +74,7 @@ func GetAllUsers() (ret []map[string]interface{}, err error) {
// 部门ids
var sourceDeptIds []string
for _, deptId := range user.Department {
sourceDeptIds = append(sourceDeptIds, fmt.Sprintf("%s_%d", config.Conf.FeiShu.Flag, deptId))
sourceDeptIds = append(sourceDeptIds, fmt.Sprintf("%s_%d", config.Conf.WeCom.Flag, deptId))
}
ele["department_ids"] = sourceDeptIds
ret = append(ret, ele)