Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试运行 EasyRTC 默认服务器代码和示例。
如果您查看 Node 控制台,您可以看到“body”中返回的 JSON 字符串。然后紧接着,我得到一个错误,“d”没有定义。JSON 是有效的,那怎么可能呢?
谢谢参观。我真的需要你的建议。
所以像往常一样,在这里发帖大约 5 分钟后,答案就来了……
body = JSON.parse(body)
console.log("typeof body=", typeof body);
返回“对象”或“字符串”?它必须是一个字符串,所以你必须先 JSON.parse 它。