钉钉小程序request请求固定的一个框架
时间:2020-03-06 00:23:34
收藏:0
阅读:376
原文:钉钉小程序request请求固定的一个框架
requestBanner: function() {
var that=this;
dd.showLoading({
content: ‘数据加载中...‘
});
dd.httpRequest({
url: app.data.globalData.url + "public/index.php/api/index/banner",
method: ‘Get‘,
success: function(res) {
dd.hideLoading();
if(res.data.code==200){
}else {
dd.showToast({
content: res.data.msg,
type: ‘fail‘,
});
}
},
fail: function() {
dd.hideLoading();
dd.showToast({
content: ‘数据请求失败‘,
type: ‘fail‘,
});
}
})
}
原文:https://www.cnblogs.com/lonelyxmas/p/12423724.html
评论(0)