目录
因服务端脚本语言不同,自行搜索设置
$.ajax({ type: "POST", url: "http://127.0.0.1:8000/api/login", data: JSON.stringify({‘num‘: 1}), dataType: ‘json‘, xhrFields: { withCredentials: true //允许跨域带Cookie }, success: function(data) { console.log(data) } })