当用数据库登录系统报如下错误时
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{
....
}
转载于:https://www.cnblogs.com/ser0632/p/5263610.html