仅限 Safari:Codesandbox 无法从本地主机服务器获取数据
Safari Only: Codesandbox unable to get data from localhost server
服务器/API:https://github.com/LambdaSchool/trinkets-api
模拟网站:https://codesandbox.io/s/pt14-httpajax-ii-0176m?file=/src/components/Item.js
在代码中,它使用 axios 从我机器上的本地服务器 运行 请求数据。它适用于 Google Chrome 但不适用于 Safari ... 为什么以及如何解决这个问题?
Safari 浏览器版本 13.1 (15609.1.20.111.8)
知道了。尝试为您的本地服务器启用 https。 Safari 不允许混合内容。参见 Safari 9 disallowed running of insecure content?
服务器/API:https://github.com/LambdaSchool/trinkets-api
模拟网站:https://codesandbox.io/s/pt14-httpajax-ii-0176m?file=/src/components/Item.js
在代码中,它使用 axios 从我机器上的本地服务器 运行 请求数据。它适用于 Google Chrome 但不适用于 Safari ... 为什么以及如何解决这个问题?
Safari 浏览器版本 13.1 (15609.1.20.111.8)
知道了。尝试为您的本地服务器启用 https。 Safari 不允许混合内容。参见 Safari 9 disallowed running of insecure content?