以下是数据:
console.log(body);
我执行console.log(body.stripe_user_id);
所以从那里我尝试了undefined
以app:
resource: "@AppBundle/Resources/config/routing.yml"
prefix: /
的形式返回。我在这里错过了什么吗?
答案 0 :(得分:0)
您的身体数据不在json formate中,只需将身体解析为json然后访问属性。
var body = {
"scope": "read_write",
"stripe_user_id": "acct_xxxxxxxxx",
"stripe_publishable_key": "pk_test_xxxxxxxxxxx",
"token_type": "bearer",
"refresh_token": "rt_xxxxxxxxxxxxxx",
"livemode": false,
"access_token": "sk_test_xxxxxxxxxxxxxxxx",
}
console.log(JSON.parse(body).stripe_user_id);