首页 > 解决方案 > Autodesk Forge :: localhost:3000 上的错误 404

问题描述

我正在尝试制作本教程(从这里Forge :查看您的模型)(php)并且我得到带有 HTTP 错误 404 的空白页面,知道吗?调试器中什么都没有,其他任何地方都没有......当调用这个uri http://localhost:3000/api/forge/oss/buckets我得到这个错误

( ! ) Notice: Undefined index: id in D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\server\oss.php on line 54
Call Stack
#   Time    Memory  Function    Location
1   0.8060  405488  {main}( )   ...\index.php:0
2   0.8591  519816  Klein\Klein->dispatch( )    ...\index.php:50
3   0.8661  552248  Klein\Klein->handleRouteCallback( ) ...\Klein.php:572
4   0.8661  552248  call_user_func:{D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\vendor\klein\klein\src\Klein\Klein.php:859} ( )    ...\Klein.php:859
5   0.8661  552248  {closure:D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\index.php:27-30}( )   ...\Klein.php:859
6   0.8661  552288  Autodesk\ForgeServices\DataManagement->getBucketsAndObjects( )  ...\index.php:29

( ! ) Fatal error: Uncaught InvalidArgumentException: Missing the required parameter $bucket_key when calling getObjects in D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\vendor\klein\klein\src\Klein\Klein.php on line 925
( ! ) Klein\Exceptions\UnhandledException: Missing the required parameter $bucket_key when calling getObjects in D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\vendor\klein\klein\src\Klein\Klein.php on line 925
Call Stack
#   Time    Memory  Function    Location
1   0.8060  405488  {main}( )   ...\index.php:0
2   0.8591  519816  Klein\Klein->dispatch( )    ...\index.php:50
3   0.8751  667432  Klein\Klein->error( )   ...\Klein.php:629

在尝试 localhost:3000/www/index.html 进行调试后,我Notice: Only variables should be passed by reference在 oss.php 文件的第 65 行得到了这个。我还注意到已加载令牌和旧存储桶 调试

标签: phpautodesk-forge

解决方案


就像塞缪尔在评论中指出的那样,存储桶密钥没有提供给后端处理程序,因此出现了错误。

但实际上前端不处理空/不正确的桶键输入,因此在后端调用了错误......如果您想在这里捕获空输入,您可以实现自己的(检查输入的桶键是否有效)。 ..


推荐阅读