Heim  >  Artikel  >  Backend-Entwicklung  >  YII2登录验证是出错!详见如下。。。

YII2登录验证是出错!详见如下。。。

WBOY
WBOYOriginal
2016-06-06 20:38:041091Durchsuche

Getting unknown property: common\models\User::password_hash

这是为什么呢?

回复内容:

Getting unknown property: common\models\User::password_hash

这是为什么呢?

你不知道翻译下这句话?
未知的属性password_hash
你在common\models\User加上$password_hash这个属性就行了,注意是public的。

<code>class User extends \yii\db\ActiveRecord implements IdentityInterface{
    public $password_hash;
    //more code
}
</code>

明显是缺少这个字段,题主应该是按照yii2 by example 那本书敲的代码吧。那里面库超里用了这个字段名,通常可能你用了password这个名称

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn