支付宝小程序的开发管理里===> 服务器域名白名单添加 自己的主域名 , 所有二级域不需要都加上
js文件里直接使用网络API
my.request({
url: 'https://gofly.sopans.com/visitors_online',
method: 'GET',
success: function(res) {
my.alert({content: 'success'});
},
fail: function(res) {
my.alert({content: 'fail'});
},
complete: function(res) {
my.hideLoading();
my.alert({content: 'complete'});
}
});