1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
| 这里是完整的js代码 const CryptoJS = require('crypto-js') l = { "tag_names": [], "corporate_regionIds": [1], "corporate_provinceIds": [], "corporate_cityIds": [], "corporate_districtIds": [], "corporate_establishDate_start": 1640966400000, "corporate_establishDate_end": 1672416000000, "funding_fundingDate_start": null, "funding_fundingDate_end": null, "corporate_locationIds": [], "corporate_rounds": [], "operator": "and", "notFromGongshang": true, "sort": 76006, "order": -1, "start": 0, "limit": 20 }
function e2(e) { if (null == (e = _u_e(e))) return null; for (var t = "", n = 0; n < e.length; n++) { var r = _p.charCodeAt(n % _p.length); t += String.fromCharCode(e.charCodeAt(n) ^ r) } return t }
function e1(e) { if (null == e) return null; for (var t, n, r, o, i, a, u, c = "", l = 0; l < e.length;) o = (t = e.charCodeAt(l++)) >> 2, i = (3 & t) << 4 | (n = e.charCodeAt(l++)) >> 4, a = (15 & n) << 2 | (r = e.charCodeAt(l++)) >> 6, u = 63 & r, isNaN(n) ? a = u = 64 : isNaN(r) && (u = 64), c = c + _keyStr.charAt(o) + _keyStr.charAt(i) + _keyStr.charAt(a) + _keyStr.charAt(u); return c }
var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" , _p = "W5D80NFZHAYB8EUI2T649RT2MNRMVE2O";
function _u_e(e) { if (null == e) return null; e = e.replace(/\r\n/g, "\n"); for (var t = "", n = 0; n < e.length; n++) { var r = e.charCodeAt(n); r < 128 ? t += String.fromCharCode(r) : r > 127 && r < 2048 ? (t += String.fromCharCode(r >> 6 | 192), t += String.fromCharCode(63 & r | 128)) : (t += String.fromCharCode(r >> 12 | 224), t += String.fromCharCode(r >> 6 & 63 | 128), t += String.fromCharCode(63 & r | 128)) } return t }
function md5(text) { const encryptedText = CryptoJS.MD5(text).toString(); return encryptedText; }
function sig(e) { return md5(e + _p).toUpperCase() }
function get_data(l) { f = e1(e2(JSON.stringify(l)))
p = sig(f)
dit = { payload: f, sig: p } return dit } console.log(get_data(l))
|