/** * ÃÜÂëΪ¿Õʱ£¬ÃÜÂë×Ö¶ÎʹÓÃÔÀ´µÄÃÜÂë */ function beforeSave($insert) { parent::beforeSave($insert); if ($this->from_password) { $this->from_password = base64_encode(SecurityHelper::encrypt($this->from_password, \Yii::$app->params['SecurityHelper'])); } else { $this->from_password = $this->old; } return true; }
public function validatePassword($password) { return SecurityHelper::validatePassword($password, $this->password); }