httpServletRequest.getSession().setAttribute(telphone,otpCode);//保存 String sessionOtpCode = (String) this.httpServletRequest.getSession().getAttribute(telphone);获取 号码是对的
$.ajax({
type:"POST",
contentType:"application/x-www-form-urlencoded",
url:"http://localhost:8090/user/login",
data:{
"telphone":$("#telphone").val(),
"password":password,
},
xhrFields: {withCredentials: true},
前端页面加上 xhrFields: {withCredentials: true},