react,fetch数据接口调用

   const params={
            parkingLotCode:this.state.parkingLotCode,
        }
        console.log(params)
   const url=baseUrl+'c/alipay/ailiH5CardPay';
        fetch(url, {
            method:'post',
            headers: {
                "Content-type":"application/json"
            },
            body:JSON.stringify(params)
        })
            .then(res=>res.json())
            .then(data=> {
                console.log(data)
            })

你可能感兴趣的:(心得)