基于axios 解决跨域cookie丢失的问题
程序员文章站
2022-06-29 22:45:13
设置 axios.defaults.withcredentials = true 即可
示例代码:
axios.defaults.withcredential...
设置 axios.defaults.withcredentials = true 即可
示例代码:
axios.defaults.withcredentials = true; var param = new urlsearchparams(); param.append("vcode",vcode); axios.post('http://localhost',param) .then(function(res) { var rs=res.data; console.log(rs.data); }) .catch(function(err) { console.log(err); });
以上这篇基于axios 解决跨域cookie丢失的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
上一篇: 阿里云云服务器Linux系统更新yum源Shell脚本
下一篇: 原生JS实现简单的无缝自动轮播效果