From 068af76756cc872c398618982f0cff27413897cf Mon Sep 17 00:00:00 2001 From: Chenx221 Date: Sat, 10 Feb 2024 12:00:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/User.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/User.php b/models/User.php index dfab168..78b62a4 100644 --- a/models/User.php +++ b/models/User.php @@ -42,10 +42,10 @@ class User extends \yii\db\ActiveRecord implements IdentityInterface public function rules() { return [ - [['username', 'password', 'password2'], 'required', 'on' => 'login'], + [['username', 'password'], 'required', 'on' => 'login'], [['username', 'password', 'email', 'password2'], 'required', 'on' => 'register'], ['username', 'string', 'min' => 3, 'max' => 12], - ['password', 'string', 'min' => 6, 'max' => 12], + ['password', 'string', 'min' => 6, 'max' => 24], ['password2', 'compare', 'compareAttribute' => 'password', 'on' => 'register'], ['email', 'email', 'on' => 'register'], ['username', 'unique', 'on' => 'register'],