问答详情
源自:3-10 用户模型管理--用户注册功能实现01

无法获取Session中的短信,为null

httpServletRequest.getSession().setAttribute(telphone,otpCode);//保存
String sessionOtpCode = (String) this.httpServletRequest.getSession().getAttribute(telphone);获取
号码是对的


提问者:慕码人4441073 2019-04-19 15:47

个回答

  • 搬砖的阿迪
    2019-05-02 18:44:48

    $.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},