12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- const jsdom = require("jsdom");
- const { JSDOM } = jsdom;
- const dom = new JSDOM(`<!DOCTYPE html><p>Hello world</p>`,
- {
- url: "https://example.org/",
- referrer: "https://example.com/",
- contentType: "text/html",
- });
- window = dom.window;
- var CryptoJS = require("crypto-js");
- var IsHttp=true
- var url=""
- var protocolStr = "http:";
- if (protocolStr == "http:") {
- url = "http://"
- IsHttp = true
- } else if (protocolStr == "https:") {
- IsHttp = false
- url = "https://"
- }
- function decryptByDES(ciphertext, key) {
- var keyHex = CryptoJS.enc.Utf8.parse(key);
- var decrypted = CryptoJS.DES.decrypt({
- ciphertext: CryptoJS.enc.Base64.parse(ciphertext)
- }, keyHex, {
- mode: CryptoJS.mode.ECB,
- padding: CryptoJS.pad.Pkcs7
- });
- return decrypted.toString(CryptoJS.enc.Utf8);
- }
- function strKey() {
- return "Ctpsp@884*"
- }
- function get_key(ciphertext, did) {
- var detail_id = did
- var data = JSON.parse(decryptByDES(JSON.parse(ciphertext), strKey()))
- var detail_pdf_url = url + "39.107.102.206:8087/bulletin/getBulletin/" + data.data + "/" + detail_id
- // var pdfUrl = "http://bulletin.sntba.com//resource/ceb/js/pdfjs-dist/web/viewer.html?file="+detail_pdf_url
- return detail_pdf_url
- }
|