There is a cross-domain problem in npm run dev, but the problem disappears after build

there is no cross-domain problem in the files that have been set up at the backend for cors,build.

two dev,localhost, ports 8080 and 8090 are open at the same time.
request for the same address, 8080 will have cross-domain problems, 8090 will not have a problem
webpack.config.js has not set up a proxy
8080:
clipboard.png

clipboard.png

8090:

clipboard.png

clipboard.png

strange.

Dec.02,2021
localhost:8080 is not set in Access-Control-Allow-Origin of

cors, but only localhost:8090
Note: this response header can only be set to one domain name, but it can be solved by setting it to dynamic.


The

question was answered without looking at the whole. Sorry

is it possible that the background only allows localhost:8080 ports to cross domains

There are agents for cross-domain configuration in

webpack .

Menu