You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

66 lines
2.3 KiB

let Rs6Service = require("../../routes/service/Rs6Service");
const UUIDUtil = require("../../utils/UUIDUtil");
let rs6Service = new Rs6Service();
let uuid = UUIDUtil.uuid;
let url = "https://etax.hubei.chinatax.gov.cn:8443/";
let areaName = "hubei";
let html = null;
let cookie = null;
let userAgent = "";
test()
async function test() {
let response = await fetch(url, {
"headers": {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-language": "zh-CN,zh;q=0.9",
"cache-control": "no-cache",
"pragma": "no-cache",
"sec-ch-ua": "\"Not/A)Brand\";v=\"8\", \"Chromium\";v=\"126\", \"Google Chrome\";v=\"126\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Linux\"",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
},
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "GET"
});
html = await response.text()
let cookies = response.headers.get('Set-Cookie');
cookie = cookies.split('; ')[0];
let res = await rs6Service.handle(url, uuid, areaName, html, cookie, userAgent)
console.log()
console.log('返回结果======>', res)
let second = await fetch(url, {
"headers": {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-language": "zh-CN,zh;q=0.9",
"cache-control": "no-cache",
"pragma": "no-cache",
"sec-ch-ua": "\"Not/A)Brand\";v=\"8\", \"Chromium\";v=\"126\", \"Google Chrome\";v=\"126\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Linux\"",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"cookie": res
},
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "GET"
});
console.log(second.status);
}