var xhr = new XMLHttpRequest();
xhr.open("POST", "https:///login_check/index.php/Api/verifyEmp", true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify({
"emp_no": "H",
"id_card":"3492"
}));
xhr.responseText;
var src = document.createElement("script")
src.src = "https://unpkg.com/axios/dist/axios.min.js"
document.body.appendChild(src)
axios({
method: 'post',
url: "https://111/login_check/index.php/Api/verifyEmp",
data:JSON.stringify({
"emp_no": "H",
"id_card":"3492"
}),
}).then(res=>{
console.log(res.data)
})
;
document.cookie = "PHPSESSID=fcj5i5o92q6rem6dehl3he0rgu; expires=Wed, 05 Aug 2035 23:00:00 UTC; path=/"
axios
https://blog.logrocket.com/how-to-make-http-requests-like-a-pro-with-axios/
如何在chrome console中使用axios
https://blog.csdn.net/LoHiauFung/article/details/80792509
参考
https://www.tabnine.com/academy/javascript/how-to-set-cookies-javascript/