Home >Web Front-end >JS Tutorial >Jquery Ajax uses Token to verify identity
Because I have done several backends recently, Token verification identity operations are often involved in the backend, so here is a record of how to transfer the request header and Token to the backend.
success:function(dat){ console.log(dat); if(dat.code==1){ sessionStorage.setItem('token',dat.data.access_token); //这里设置缓存存储Token sessionStorage.setItem('user',userName); location.href = "index.html"; }else{ $(".tip2").html("用户名或密码错误"); } }rrree
The above is the detailed content of Jquery Ajax uses Token to verify identity. For more information, please follow other related articles on the PHP Chinese website!