1.实现API promise化
npm install --save miniprogram-api-promise@1.0.4
2.构建miniprogram_npm,先把miniprogram_npm删除,再点击工具->构建npm
3.
4.页面使用
javascript
async getInfo(){
const {data:res} =await wx.p.request({
method:'GET',
url:'https://applet-base-api-t.itheima.net/api/get',
data:{
name:'zhangsan',
age:20
}
})
console.log(res);
},