你还在预约口罩预约不上吗,教你通过代码抢口罩

疫情大背景下,各地都是买个口罩都费劲;而且还是秒抢光,怎么办?

以下代码只为抢口罩更快捷,请勿用于非法用途。造成法律问题,请自行了断;

第一步,打开预约链接 按F12 打开调试界面

青岛政务预约口罩链接
在这里插入图片描述

第二布,将该段代码复制到 console 下的 空白处

当前代码根据青岛口罩预约,如需要请自己修改自己所在地预约网址

var code = "";  //如果抢口罩需要输入验证码,请把页面上的验证码写到这儿
var url = "http://kzyynew.qingdao.gov.cn:81/kz/addYdorder?capval=" + code;
function toAppoint(){
	if(code === ""){
	console.log("请输入验证码");
	}else{
		var httpRequest = new XMLHttpRequest();
		httpRequest.open('POST' ,url , true); 
		httpRequest.setRequestHeader("Content-type","application/json");
		var obj = {"address":"","name":"","mobile":"","code":"","area":"市北区","street":"","capval":"","ordertype":1};//本段JSON为预约必须字段
		
		obj.address = '卓越中心1号楼1901';
		obj.name = "刘杰";
		obj.mobile = "176xxxx6541";
		obj.code = "37092319930111xxxx";
		obj.area = "市北区";
		obj.street = "敦化路街道办事处";
		obj.capval = code;
		obj.ordertype = 1;//1是邮政2是顺丰
		httpRequest.send(JSON.stringify(obj));
		httpRequest.onreadystatechange = function () {
			if (httpRequest.readyState == 4 && httpRequest.status == 200) {
				var json = httpRequest.responseText;//获取到服务端返回的数据
				console.log(json);
			}else {
				console.log("预约失败:"+  httpRequest.status);
			}
		};
	}
}
toAppoint();

如下图所示在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章