支付宝小程序如何写接口?

baobiaocontent() {
my.request({
url: ‘url地址’,
method: ‘类型’,
headers: { ‘content-type’: ‘application/x-www-form-urlencoded’ }, //死的 就是这么写的
data: {
后台所要的参数
},
dataType: ‘json’,
success: (res) => {
if (res.data.code == 100000) {
console.log(res) //成功了会怎么样!
})

    }
  },
  fail: function (res) {

  },
  complete: function (res) {

  }
});

},

发布了5 篇原创文章 · 获赞 4 · 访问量 439

猜你喜欢

转载自blog.csdn.net/a13145211/article/details/103617880