How to Solve Error: failed to load response

reason:

Because the back-end does not write cross-domain-related information to the header, the front-end cannot load data.

analysis:

1. First, check whether there are cross-domain-related configurations in the project, and then find out whether there are configurations.

2. This should be added only when the controller is executed.

3. Because our project has built an interceptor to intercept the token parsing into user-related information, because if there is no token expiration, the interceptor will throw an exception. When returning, cross-domain-related things will not be added. So the front end cannot be loaded.

Solution:

Add response and related cross domain information to the interceptor

In addition, you need to know the execution sequence of interceptors and filters

* ** ->  Filter -> Interceptor -> ControllerAdvice -> Aspect -> Controller

Read More: