-
-
Notifications
You must be signed in to change notification settings - Fork 297
1、增加用户密码随时产生8位,由大小写字母、数字、特殊字符。 2、增加添加用户时新用户名和密码通过邮箱发送给用户。 #230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
请问这个pr是否还会有新的功能? |
这个功能怎么使用? |
未合并,无法用,太过久远,就不合并了 |
后面会做上么?不然每次建立用户都需要去修改密码 也是麻烦,自动发一个随机密码去邮箱我觉得是一个不错的功能 |
@MonkeyCode-AI review |
}) | ||
if err != nil { | ||
common.Log.Errorf("eteststset: %v", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在定时任务错误处理中,日志输出的错误信息"eteststset"看起来像是测试代码残留,应该改为更有意义的错误描述。
} | |
common.Log.Errorf("Failed to add user expiration check cron job: %v", err) |
|
||
const ( | ||
passwordLength = 8 | ||
letters = "abcdefghijklmnopqrstu@vwxyzABCDEFGHIJKL#MNOP*QRSTUVWXYZ0123456789" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
随机密码生成函数中的字符集缺少一些常用的特殊字符,如$、%、&、!等,这可能会降低密码的强度。
letters = "abcdefghijklmnopqrstu@vwxyzABCDEFGHIJKL#MNOP*QRSTUVWXYZ0123456789" | |
letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%&*!" |
} | ||
modifyPass := ldap.NewPasswordModifyRequest(udn, "", "") | ||
//默认产生8位随机密码,不符合公司规范,故生成16位随机密码 | ||
newPasswd := tools.GenerateRandomPassword() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在NewPwd函数中,注释说明生成16位随机密码,但实际代码中调用GenerateRandomPassword()函数并未指定长度(默认8位),与注释不符。建议添加一个可指定长度的密码生成函数。
newPasswd := tools.GenerateRandomPassword() | |
// 默认产生8位随机密码,不符合公司规范,故生成16位随机密码 | |
// newPasswd := tools.GenerateRandomPassword() | |
newPasswd := tools.GenerateRandomPasswordWithLength(16) |
⏳ MonkeyCode-AI 正在分析,请稍等片刻... |
在提出此拉取请求时,我确认了以下几点(请复选框):
填写PR内容: