The front-end requests cross-domain, which turned out to be a limitation of Google Chrome

There is a background project. I haven’t touched this project since I came to the company. I recently received a request for this project. I started the project today to prepare for development. When I logged in, I encountered cross-domain problems. I opened it with Google and reported the following cross-domain problems:

Access to XMLHttpRequest at ‘http://yhjr-b-dev.yhjr-bd-bservice.devgw.yonghui.cn/login/getSmsCode’ from origin ‘http://0.0.0.0:8083’ has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space private.

insert image description here
insert image description here
Check the front-end first, then check the back-end and O&M together, and finally find that Google Chrome has been upgraded. The browser comes with a Block insecure private network requests to prevent insecure contexts from sending subresource requests to more private IP addresses. So just change this setting, as follows:

  1. URL ground input: chrome://flags/
    insert image description here

  2. Search for Block insecure private network requests in Search flags
    insert image description here

  3. Change the default to Disabled, and a prompt will pop up below:
    insert image description here

  4. Click relaunch to restart the browser:
    insert image description here
    after restarting, you can request again, which is perfect, as follows:
    insert image description here

Guess you like

Origin blog.csdn.net/qq_30627241/article/details/127631139