This commit is contained in:
laodaming 2023-11-23 11:19:11 +08:00
parent f86c687bd8
commit 982f5e1df9
2 changed files with 10 additions and 1 deletions

View File

@ -57,7 +57,7 @@ func (l *UpdateLdapUserLogic) UpdateLdapUser(req *types.UpdateLdapUserReq, r *ht
} }
//把用户名转pinyin //把用户名转pinyin
userNamePinyin := chinese_to_pinyin.ChineseToPinyin(req.UserName) userNamePinyin := chinese_to_pinyin.ChineseToPinyin(req.UserName)
now := time.Now() now := time.Now().UTC()
//更新的属性 //更新的属性
attr := map[string][]string{ attr := map[string][]string{
"homeDirectory": {"/home/users/" + userNamePinyin}, "homeDirectory": {"/home/users/" + userNamePinyin},

View File

@ -1,10 +1,12 @@
package logic package logic
import ( import (
"fusenapi/model/gmodel"
"fusenapi/utils/basic" "fusenapi/utils/basic"
"fusenapi/utils/email" "fusenapi/utils/email"
"net/http" "net/http"
"strings" "strings"
"time"
"context" "context"
@ -66,6 +68,13 @@ func (l *UpdateLdapUserPwdLogic) UpdateLdapUserPwd(req *types.UpdateLdapUserPwdR
logx.Error(err) logx.Error(err)
return resp.SetStatusWithMessage(basic.CodeServiceErr, "修改密码失败") return resp.SetStatusWithMessage(basic.CodeServiceErr, "修改密码失败")
} }
now := time.Now().UTC()
err = l.svcCtx.AllModels.LdapUser.Update(l.ctx, req.UserDN, &gmodel.LdapUser{
Utime: &now,
})
if err != nil {
logx.Error(err)
}
return resp.SetStatusWithMessage(basic.CodeOK, "修改密码成功") return resp.SetStatusWithMessage(basic.CodeOK, "修改密码成功")
} }