2017-10-22 09:45:25 4687次浏览 1条回答 1 悬赏 40 金钱

yii2 vue中axios post登陆请求,yii2无法获取到数据

  • 回答于 2017-10-23 15:39 举报

    axios发出的请求数据默认是json格式的,yii里要接收的话参考http://www.51siyuan.cn/33.html

    2 条回复
    回复于 2017-10-23 18:33 回复

    配置文件改成 还是不可以

    'parsers' => [
        'application/json' => 'yii\web\JsonParser',
        'application/xml' => 'common\components\XmlParser',
        'text/xml' => 'common\components\XmlParser'
    ]
    
    回复于 2017-10-25 09:47 回复

    xml的你不需要,Yii::$app->request->getBodyParams()

您需要登录后才可以回答。登录 | 立即注册
ok
助理

ok

注册时间:2017-03-01
最后登录:2022-03-22
在线时长:14小时45分
  • 粉丝1
  • 金钱50
  • 威望0
  • 积分190

热门问题