Просмотр исходного кода

创建管理员验证密码长度

evoxwht 2 лет назад
Родитель
Сommit
5e0b2b940e
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      crmeb/app/services/system/admin/SystemAdminServices.php

+ 9 - 0
crmeb/app/services/system/admin/SystemAdminServices.php

@@ -257,6 +257,10 @@ class SystemAdminServices extends BaseServices
         }
         unset($data['conf_pwd']);
 
+        if (strlen(trim($data['pwd'])) < 6 || strlen(trim($data['pwd'])) > 32) {
+            return app('json')->fail(400762);
+        }
+
         if ($this->dao->count(['account' => $data['account'], 'is_del' => 0])) {
             throw new AdminException(400596);
         }
@@ -319,6 +323,11 @@ class SystemAdminServices extends BaseServices
             if ($data['conf_pwd'] != $data['pwd']) {
                 throw new AdminException(400264);
             }
+
+            if (strlen(trim($data['pwd'])) < 6 || strlen(trim($data['pwd'])) > 32) {
+                return app('json')->fail(400762);
+            }
+
             $adminInfo->pwd = $this->passwordHash($data['pwd']);
         }
         //修改账号