feat(admin): 后台管理员新增/修改密码增加复杂度校验
- 由原来仅限制 6-30 位非空白字符,改为必须同时包含字母、数字和特殊字符 - 新增与编辑两条分支同步生效 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
4e5c05dfc3
commit
980aa88294
@ -125,7 +125,7 @@ class Admin extends Backend
|
||||
if ($params) {
|
||||
Db::startTrans();
|
||||
try {
|
||||
if (!Validate::is($params['password'], '\S{6,30}')) {
|
||||
if (!Validate::is($params['password'], '(?=.*[A-Za-z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};\':",.\/<>?|~`])\S{6,30}')) {
|
||||
exception(__("Please input correct password"));
|
||||
}
|
||||
$params['salt'] = Random::alnum();
|
||||
@ -179,7 +179,7 @@ class Admin extends Backend
|
||||
Db::startTrans();
|
||||
try {
|
||||
if ($params['password']) {
|
||||
if (!Validate::is($params['password'], '\S{6,30}')) {
|
||||
if (!Validate::is($params['password'], '(?=.*[A-Za-z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};\':",.\/<>?|~`])\S{6,30}')) {
|
||||
exception(__("Please input correct password"));
|
||||
}
|
||||
$params['salt'] = Random::alnum();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user