萌新求问wx.request中写localhost遇到的问题

topduke 2018-02-03 12:49:01

requrest: function () {
wx.request({
url: 'http://localhost:8080/1.php',

method: 'POST',
success: function (res) {
console.log(res.data);
},
fail: function (res) {
console.log('submit fail');
},
complete: function (res) {
console.log('submit complete');
}
})
},
用一个简单项目试一下request这个api,在网上查看了好多资料,可以用localhost ,我本地的数据库有的是wamp mysql 。
在url中如上写到,但是一直出现下面的问题:
console中出现下面的问题:
Do not have request handler in current page: pages/index/index. Please make sure that request handler has been defined in pages/index/index, or pages/index/index has been added into app.json
求问是怎么回事,环境配置的问题还是url写的不对
...全文
415 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
二月十六 2018-02-03
  • 打赏
  • 举报
回复
萌新你问错地方了,这里是mssql版块

27,579

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 应用实例
社区管理员
  • 应用实例社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧