在小程序中怎样调用本地接口

2020-08-17 09:24:56

1、点击详情,并勾选项目设置中最后一行。

0d5fd1b07899e2b34a9737ae3f84cca.png

2、用小程序请求本地的后台服务接口

wx.request({        url: 'http://localhost:8090/DemoProject/myTest.do',        data:{},        method:'POST',        header: {          'content-type': 'application/x-www-form-urlencoded'        },        success: function (res) {          console.log(res.data)        }      })