1.前端返回需要Access-Control-Allow-Credentials
异常信息
Access to XMLHttpRequest at 'http://localhost:9999/homeManager/user/login'
from origin 'http://192.168.1.12:8000' has been blocked by CORS policy:
The value of the 'Access-Control-Allow-Credentials' header in the response is '' which
must be 'true' when the request's credentials mode is 'include'.
The credentials mode of requests initiated
by the XMLHttpRequest is controlled by the withCredentials attribute.
解决方案
后端返回增加
response.setHeader("Access-Control-Allow-Credentials", "true");