WXS里面能发送wx.request请求给后端吗?
<wxs module=“m1”>
var countPicture = function(postId) {
var count = undefined;
wx.request({
url: 'http://localhost:8088/postBase/countPicture’,
method: ‘post’,
data: {
postId:postId
},
header: {
‘content-type’: ‘application/json’
},
success(res) {
count = res.data.data;
}
})
return count;
}
module.exports.countPicture = countPicture;
</wxs>