封装微信小程序request请求
//创建一个js文件 抛出
export const getRequest = (url, data = {}) => {
wx.showLoading({ title: "加载中" })
return new Promise((resolve, reject) => {
wx.request({
url, //仅为示例,并非真实的接口地址
data, //data为对象
method: "get",
succe
原创
2021-03-29 19:22:11 ·
134 阅读 ·
0 评论