const jsdom = require("jsdom"); const {JSDOM} = jsdom; const dom = new JSDOM(`
Hello world
`, { url: "https://example.org/", referrer: "https://example.com/", contentType: "text/html", }); window = dom.window; document = window.document; location = window.location; navigator = window.navigator CryptoJS = require('crypto-js') function get_pm(req_pm) { const sF = "zxcvbnmlkjhgfdsaqwertyuiop0987654321QWERTYUIOPLKJHGFDSAZXCVBNM" , ine = sF + "-@#$%^&*+!"; function qu(e = []) { return e.map(t => ine[t]).join("") } const a = Date.now() , l = ane(16) , c = qu([8, 28, 20, 42, 21, 53, 65, 6]) , d = { [qu([56, 62, 52, 11, 23, 62, 39, 18, 16, 62, 54, 25, 25])]: qu([11, 11, 0, 21, 62, 25, 24, 19, 20, 15, 7]), [qu([56, 62, 52, 11, 23, 62, 39, 18, 16, 62, 60, 24, 5, 2, 18])]: l, [qu([56, 62, 52, 11, 23, 62, 39, 18, 16, 62, 40, 23, 6, 18, 14, 20, 15, 6, 25])]: a.toString() } function sne(e, t) { switch (arguments.length) { case 1: return parseInt(Math.random() * e + 1, 10); case 2: return parseInt(Math.random() * (t - e + 1) + e, 10); default: return 0 } } function ane(e) { return [...Array(e)].map(() => sF[sne(0, 61)]).join("") } function lne(e) { let t = ""; return typeof e == "object" ? t = Object.keys(e).map(n => `${n}=${e[n]}`).sort().join("&") : typeof e == "string" && (t = e.split("&").sort().join("&")), t } function $g(e = {}) { const {p: t, t: n, n: u, k: o} = e , r = lne(t); return CryptoJS.SHA256(u + o + decodeURIComponent(r) + n).toString() } p = $g({ p: req_pm, t: a, n: l, k: c }) d[[qu([56, 62, 52, 11, 23, 62, 39, 18, 16, 62, 53, 23, 11, 5, 15, 20, 22, 19, 18])]] = p return d } function create_href(e) { const t = e.pubServicePlat , n = e.noticeSecondTypeDesc; if (e.edition === "v0") { const pm = { source: t, titleDetails: n }, b_url = `https://ygp.gdzwfw.gov.cn/#/440800/new/jygg/${e.noticeId}`; const sParams = new URLSearchParams(pm); const mUrl = `${b_url}?${sParams.toString()}`; return mUrl } const c = { noticeId: e.noticeId, projectCode: e.projectCode, bizCode: e.tradingProcess, siteCode: e.regionCode, publishDate: e.publishDate, source: t, titleDetails: n, classify: e.projectType } , base_url = `https://ygp.gdzwfw.gov.cn/#/440800/new/jygg/${e.edition}/${e.noticeSecondType}`; const searchParams = new URLSearchParams(c); const mergedUrl = `${base_url}?${searchParams.toString()}`; return mergedUrl }