Yii2 登录报错

当用数据库登录系统报如下错误时

PHP Recoverable Error – yii\base\ErrorException

Argument 1 passed to yii\web\User::login() must be an instance of yii\web\IdentityInterface, instance of app\modules\admin\models\AdminUser given, called in /home/ser/web_root/sun/modules/admin/models/LoginForm.php on line 61 and defined

 

请把之前的类定义改成如下语句

class AdminUser extends \yii\db\ActiveRecord implements \yii\web\IdentityInterface{

....

}

posted on 2016-03-10 21:44  沈恩忍  阅读(416)  评论(0编辑  收藏  举报

导航