dingjj2010
1.按照权威指南解释:yii\web\IdentityInterface::getAuthKey():获取基于 cookie 登录时使用的认证密钥。 认证密钥储存在 cookie 里并且将来会与服务端的版本进行比较以确保 cookie的有效性。具体引用位置在yii\web\user里面loginByCookie方法。
2.需要在你的用户表里面添加这一个字段。
3.直接返回id肯定是会出问题的,就比如你validateAuthKey()的时候就会出错,除非你authkey字段存的就是id的值。所以尽量是存的时候就用Yii::$app->security->generateRandomString()获取随机字符。
4.getAuthKey(),应该返回AuthKey。- dingjj2010 2015-10-28 已签到连续签到2天,获得了10个金钱
- dingjj2010 2015-10-27 已签到连续签到1天,获得了5个金钱
- dingjj2010 2015-10-22 已签到连续签到3天,获得了15个金钱
- dingjj2010 2015-10-21 已签到连续签到2天,获得了10个金钱
- dingjj2010 回复了 dingjj2010 的回答
首先确认下你的pcontroller里面是有继承controller基类的?
@花小白 不需要把index.php加进去,只需要modules/controller/action。
- dingjj2010 回复了 dingjj2010 的回答
rules 里面 'login' => '/service/login'=> 'login' => 'service/login' 斜杠去掉试试。
不行就把log贴出来。@tgy3300 .htaccess这个文件有没有。
还是你的比较简单 我一般是这么写的
$a = a::find() ->where([a::tableName() . '.id' => $ids]) ->With(['b'=>function($query){$query->with('c');}]) ->all();
说明一点:
findOne()
,findAll()
,和find()->one()
,find()->all()
是走不一样的代码的。后一种才是走的query。新建一个layout,asset。或者直接在代码里面添加