This commit is contained in:
laodaming 2023-11-21 10:08:46 +08:00
parent ce1ea141d2
commit f4cbb23aa0

View File

@ -74,18 +74,18 @@ func (l *CreateLdapUserLogic) CreateLdapUser(req *types.CreateLdapUserReq, useri
"shadowWarning": {"7"}, //固有属性
"loginShell": {"/usr/sbin/nologin"}, //固有属性
"homeDirectory": {"/home/users/" + userNamePinyin},
"employeeType": {fmt.Sprintf("%d", req.EmployeeType)}, //1正式 2实习 3外包
"uidNumber": {fmt.Sprintf("%d", userData.Id)},
"gidNumber": {fmt.Sprintf("%d", userData.Id)},
"uid": {userNamePinyin},
"cn": {req.Email},
"sn": {req.UserName},
"mail": {req.Email},
"postalCode": {fmt.Sprintf("%d", req.Status)},
"departmentNumber": {"0"},
"postalAddress": {req.Avatar},
"mobile": {req.Mobile},
"userPassword": {"{crypt}" + pwd},
"employeeType": {fmt.Sprintf("%d", req.EmployeeType)}, //员工类型:1正式 2实习 3外包
"uidNumber": {fmt.Sprintf("%d", userData.Id)}, //用户id
"gidNumber": {fmt.Sprintf("%d", userData.Id)}, //用户id
"uid": {userNamePinyin}, //用户名(拼音)
"cn": {req.Email}, //邮箱
"sn": {req.UserName}, //用户名
"mail": {req.Email}, //邮箱
"postalCode": {fmt.Sprintf("%d", req.Status)}, //状态
"departmentNumber": {fmt.Sprintf("%d", req.GroupId)}, //权限分组id
"postalAddress": {req.Avatar}, //头像
"mobile": {req.Mobile}, //手机号
"userPassword": {"{crypt}" + pwd}, //密码
}); err != nil {
logx.Error(err)
return resp.SetStatusWithMessage(basic.CodeServiceErr, "添加用户失败,"+err.Error())