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