Console error message
Access to XMLHttpRequest at 'http://**/login' from origin 'http://**:9528' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
errError: Network Error
Cause analysis
According to Access-Control-Allow-Origin
, it can be seen that it is a cross domain problem. If one address accesses another address, if any of the three places is different in this process, cross domain problems will occur.
1. Access agreement
HTTP, https
2. The port number is different
My error report here is to use 9528 to access 8001
3. Different IP addresses
Solution:
1. Add a comment on the back-end interface controller @CrossOrigin
2. Use the gateway to solve the problem
Read More:
- [Solved] Kafka Error: is/are not present and missingTopicsFatal is true
- [Solved] Spring Kafka Send Error in specifies partition: Topic radar not present in metadata after 60000
- [Solved] the resource is not on the build path of a java project
- SpringBoot :Error parsing HTTP request header [How to Solve]
- JAVA: Random access file is always garbled
- Idea Error 404: The project ssmbuild is unavailable/the target resource cannot be found
- [Solved] Resource compilation failed (Failed to compile values resource file…
- Resources is configured in the build of Maven project to prevent the failure of resource export
- The number of control threads and concurrency number of concurrent executor of Java starting gun
- Client Error: Could not get a resource from the pool [How to Solve]
- CreateProcess error = 5, access denied. [How to Solve]
- [Solved] hadoop Error: 9000 failed on connection exception java.net.ConnectException Denied to Access
- Doris Error: there is no scanNode Backend [How to Solve]
- Error creating bean with name ‘servletEndpointRegistrar‘ defined in class path resource
- [Solved] Read the resources resource and convert it to file error: java.io.filenotfoundexception
- [Solved] RabbitMQ Error: Error creating bean with name ‘rabbitConnectionFactory‘ defined in class path resource
- [Solved] Springboot Error: swagger-UI/index.html Access Error 404
- Eclipse relies on spring boot configuration processor, and there is no prompt for writing properties and YML
- idea Error: Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource
- [Solved] The Bean Validation API is on the classpath but no implementation could be found