Yii2 中配置方法汇总
1.默认框架接收的是x-www-format-unencode格式的数据,如果想要接收text/json格式的数据,会为空,这个时候需要在配置文件中添加对应的配置项 config > main.php
commonents: 'request' => [ 'enableCookieValidation' => false, 'parsers' => [ 'application/json' => 'yii\web\JsonParser', 'text/json' => 'yii\web\JsonParser', ] ],
2. 设置框架的时区
config > main.php
return [ "timeZone"=> 'Asia/Shanghai', 'components'=[ ... ] ]

浙公网安备 33010602011771号