为什么要加一个参数data?
来源:5-7 封装数据请求

Jerry卢
2020-11-25
export default function $http(options) {
const { url, data } = options
return new Promise((reslove, reject) => {
uniCloud.callFunction({
name: url,
data
}).then( res => {
if (res.result.code === 200) {
reslove(res.result)
} else {
reject(res.result)
}
}).catch(err => {
reject(err)
})
})
}
为什么这里的options里会解构出data?还有uniCloud.callFunction里面为啥还要加上这个data参数?这个data是啥
写回答
1回答
-
慕村6345035
2020-11-25
data 是云函数的参数 https://uniapp.dcloud.io/uniCloud/cf-functions?id=callbyfunction
022020-12-27
相似问题