代码之家  ›  专栏  ›  技术社区  ›  BeHappy

在ip地址上运行react时出现问题

  •  0
  • BeHappy  · 技术社区  · 5 年前

    React应用程序编译成功,当我打开它时 localhost 没有问题。但当我用ip打开它时,我遇到了错误。

    以下是成功编译的反应:

    enter image description here

    当我用打开应用程序时出错 http://192.168.1.101:300

    enter image description here

    看起来chrome试试看 https 而不是 http .

    我尝试使用其他端口,但遇到了同样的问题。

    更新

    我也注意到了这一点:

    enter image description here

    0 回复  |  直到 5 年前
        1
  •  1
  •   BeHappy    5 年前

    我只是删除 <meta http-equiv="Content-Security-Policy" content="default-src 'self'"> head 在html中。问题解决了。

    推荐文章