登录后进行操作,user->identity为null [ 2.0 版本 ]
登录成功后的用户信息是存在的,但是做点击菜单或任何操作identity为null
一粒坏汤屎 补充于 2018-10-26 14:13
这个问题本地没发生,只发生在测试和生产环境,backend没问题,frontend有问题,
共 2 个回答
-
你得把common和frontend的mian.php配置贴出来才好排查,还有backend和frontend一般不同域名,backend登录在frontend是无效的
共 2 条回复'vendorPath' => dirname(dirname(DIR)) . '/vendor',
'timeZone' => 'Asia/Shanghai', 'components' => [ 'db' => [ 'class' => 'yii\db\Connection', 'dsn' => 'mysql:host=localhost;dbname=kf_cem', 'username' => 'cem', 'password' => 'cem!@SY2018', 'charset' => 'utf8' ], 'cache' => [ 'class' => 'yii\caching\FileCache', ], 'image' => [ 'class' => 'yii\image\ImageDriver', 'driver' => 'GD', //GD or Imagick ], 'session' => [ 'timeout' => 3600, ], 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'levels' => ['error','warning','info'], ], ], ],
没什么特别的阿,backend和frontend登录是分开的
'id' => 'app-frontend', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'controllerNamespace' => 'frontend\controllers', 'defaultRoute' => 'site', 'modules' => [ 'wap'=>[ 'class'=>'app\modules\wap\WapModule', ], 'agent'=>[ 'class'=>'app\modules\agent\AgentModule', ], 'salesClerk'=>[ 'class'=>'app\modules\salesClerk\SalesClerkModule' ] ], 'components' => [ 'user' => [ 'identityClass' => 'common\models\PayUser', 'enableAutoLogin' => true, ], 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'levels' => ['error','warning','info'], 'categories' => ['pay'], 'logFile' => '@app/runtime/logs/pay.log', ], ], ], 'errorHandler' => [ 'errorAction' => 'site/error', ], 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ ], ], 'request' => [ 'cookieValidationKey' => 'fill in a secret key here', ], ],
一粒坏汤屎
注册时间:2018-10-24
最后登录:2019-01-25
在线时长:2小时37分
最后登录:2019-01-25
在线时长:2小时37分
- 粉丝0
- 金钱5
- 威望0
- 积分25