请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

项目源代码部分的小程序接口报500错误,但浏览器打开正常

我尝试直接复制链接至浏览器可以正常返回数据,但是在小程序中运行,一直报500错误。

小程序停留一直加载中。不知是什么问题。


小程序调试打印内容

asdebug.js:1 GET http://menchaitob.me/index.php/api/v1/product/recent 500 (Internal Server Error)v @ asdebug.js:1a @ asdebug.js:1r @ WAService.js:4u @ WAService.js:4request @ WAService.js:3(anonymous function) @ WAService.js:4request @ base.js [sm]:25getProductorData @ home-model.js [sm]:45_loadData @ home.js [sm]:31(anonymous function) @ WAService.js:7onLoad @ home.js [sm]:8(anonymous function) @ WAService.js:7A @ WAService.js:7O @ WAService.js:7j @ WAService.js:7(anonymous function) @ WAService.js:7(anonymous function) @ WAService.js:7(anonymous function) @ WAService.js:4(anonymous function) @ WAService.js:4(anonymous function) @ WAService.js:4(anonymous function) @ asdebug.js:1n.emit @ asdebug.js:1r @ asdebug.js:1g @ asdebug.js:1(anonymous function) @ asdebug.js:1

base.js [sm]:60 Object {errMsg: "request:ok", data: Array[15], header: Object, statusCode: 500}

asdebug.js:1 GET http://menchaitob.me/index.php/api/v1/theme?ids=1,2,3 500 (Internal Server Error)v @ asdebug.js:1a @ asdebug.js:1r @ WAService.js:4u @ WAService.js:4request @ WAService.js:3(anonymous function) @ WAService.js:4request @ base.js [sm]:25getThemeData @ home-model.js [sm]:34_loadData @ home.js [sm]:23(anonymous function) @ WAService.js:7onLoad @ home.js [sm]:8(anonymous function) @ WAService.js:7A @ WAService.js:7O @ WAService.js:7j @ WAService.js:7(anonymous function) @ WAService.js:7(anonymous function) @ WAService.js:7(anonymous function) @ WAService.js:4(anonymous function) @ WAService.js:4(anonymous function) @ WAService.js:4(anonymous function) @ asdebug.js:1n.emit @ asdebug.js:1r @ asdebug.js:1g @ asdebug.js:1(anonymous function) @ asdebug.js:1

asdebug.js:1 GET http://menchaitob.me/index.php/api/v1/banner/1 500 (Internal Server Error)v @ asdebug.js:1a @ asdebug.js:1r @ WAService.js:4u @ WAService.js:4request @ WAService.js:3(anonymous function) @ WAService.js:4request @ base.js [sm]:25getBannerData @ home-model.js [sm]:24_loadData @ home.js [sm]:16(anonymous function) @ WAService.js:7onLoad @ home.js [sm]:8(anonymous function) @ WAService.js:7A @ WAService.js:7O @ WAService.js:7j @ WAService.js:7(anonymous function) @ WAService.js:7(anonymous function) @ WAService.js:7(anonymous function) @ WAService.js:4(anonymous function) @ WAService.js:4(anonymous function) @ WAService.js:4(anonymous function) @ asdebug.js:1n.emit @ asdebug.js:1r @ asdebug.js:1g @ asdebug.js:1(anonymous function) @ asdebug.js:1

base.js [sm]:60 Object {errMsg: "request:ok", data: Array[3], header: Object, statusCode: 500}

base.js [sm]:60 Object {errMsg: "request:ok", data: Object, header: Object, statusCode: 500}

WAService.js:7 Invoke event onReady in page: pages/home/home

WAService.js:7 pages/home/home: onReady have been invoked

asdebug.js:1 POST http://menchaitob.me/index.php/api/v1/token/user 500 (Internal Server Error)


正在回答

2回答

这个是在太难看出来了。你可不可以按照课程的方法,在服务器打个断点看看哪里报错了

0 回复 有任何疑惑可以回复我~
  • 提问者 慕粉4153973 #1
    非常感谢!
    回复 有任何疑惑可以回复我~ 2017-06-17 17:58:29
  • 提问者 慕粉4153973 #2
    MAC系统文件权限问题,遇到同学注意一下。
    回复 有任何疑惑可以回复我~ 2017-06-17 17:59:16
提问者 慕粉4153973 2017-06-09 00:36:02

这个问题系mac 系统未对tp5项目文件夹设置足够权限导致的。

返还200的http状态码,都变成了500了。虽然不知道为什么,

但设置了777权限之后确实恢复正常了。

0 回复 有任何疑惑可以回复我~
  • 7七月 #1
    课是你不是说 浏览器可以访问吗
    回复 有任何疑惑可以回复我~ 2017-06-09 05:03:23
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信