企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
fly文档中文<https://wendux.github.io/dist/#/doc/flyio/readme> <https://unpkg.com/flyio/dist/fly.min.js> axios中文文档<http://www.axios-js.com/> axios<https://cdn.bootcss.com/axios/0.19.0/axios.min.js> qs<https://cdn.bootcss.com/qs/6.7.0/qs.min.js>解决跨域 `npm install flyio` ~~~ fly.get('{php echo $this->createWebUrl("ajax",["id"=>123])}') .then(function (response) { console.log(response.data); }) .catch(function (error) { console.log(error); }); fly.get('/user', { id: 133 }).then((response)=>{ console.log(response.data.list.user); }) fly.post('/user', { name: 'Doris', age: 24 phone:"18513222525" }) fly.request('{php echo $this->createWebUrl("ajax",["id"=>123])}',{"qq":"234"},{method:"post"}) php需要file_get_contents("php://input");接收 var qs = require('qs'); //解决正常$_POST/$_GET接收 fly.post('/foo', qs.stringify({ 'bar': 123 })); ~~~ `npm install axios` ~~~ axios.get('/user?ID=12345') .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); axios.get('/user', { params: { ID: 12345 } }) axios.post('/user', { firstName: 'Fred', lastName: 'Flintstone' }) axios({ method: 'post', url: '/user/12345', data: { firstName: 'Fred', lastName: 'Flintstone' } }); const qs = require('qs'); axios.post('/foo', qs.stringify({ 'bar': 123 })); ~~~