【发布时间】:2022-01-25 14:02:54
【问题描述】:
我正在尝试从 Magento 2 获取数据,但我在控制台上收到此错误
The consumer isn't authorized to access %resources.", parameters: {…}, trace: '#0 /var/www/html/magento/vendor/magento/module-web…Magento\\Framework\\App\\Bootstrap->run()\n#16 {main}'}
我想我需要添加一个访问令牌来获取数据,但我不知道如何将令牌添加到我的代码中
fetch("https:.....com/rest/V1/categories")
.then((response) => response.json())
.then((json) => console.log(json));
【问题讨论】: