| 787 | }) |
| 788 | } |
| 789 | function decrypt(time, stk, type, url) { |
| 790 | stk = stk || (url ? getUrlData(url, '_stk') : '') |
| 791 | if (stk) { |
| 792 | const timestamp = new Date(time).Format("yyyyMMddhhmmssSSS"); |
| 793 | let hash1 = ''; |
| 794 | if ($.fingerprint && $.token && $.enCryptMethodJD) { |
| 795 | hash1 = $.enCryptMethodJD($.token, $.fingerprint.toString(), timestamp.toString(), $.appId.toString(), $.CryptoJS).toString($.CryptoJS.enc.Hex); |
| 796 | } else { |
| 797 | const random = '5gkjB6SpmC9s'; |
| 798 | $.token = `tk01wcdf61cb3a8nYUtHcmhSUFFCfddDPRvKvYaMjHkxo6Aj7dhzO+GXGFa9nPXfcgT+mULoF1b1YIS1ghvSlbwhE0Xc`; |
| 799 | $.fingerprint = 5287160221454703; |
| 800 | const str = `${$.token}${$.fingerprint}${timestamp}${$.appId}${random}`; |
| 801 | hash1 = $.CryptoJS.SHA512(str, $.token).toString($.CryptoJS.enc.Hex); |
| 802 | } |
| 803 | let st = ''; |
| 804 | stk.split(',').map((item, index) => { |
| 805 | st += `${item}:${getUrlData(url, item)}${index === stk.split(',').length -1 ? '' : '&'}`; |
| 806 | }) |
| 807 | const hash2 = $.CryptoJS.HmacSHA256(st, hash1.toString()).toString($.CryptoJS.enc.Hex); |
| 808 | // console.log(`\nst:${st}`) |
| 809 | // console.log(`h5st:${["".concat(timestamp.toString()), "".concat(fingerprint.toString()), "".concat($.appId.toString()), "".concat(token), "".concat(hash2)].join(";")}\n`) |
| 810 | return encodeURIComponent(["".concat(timestamp.toString()), "".concat($.fingerprint.toString()), "".concat($.appId.toString()), "".concat($.token), "".concat(hash2)].join(";")) |
| 811 | } else { |
| 812 | return '20210318144213808;8277529360925161;10001;tk01w952a1b73a8nU0luMGtBanZTHCgj0KFVwDa4n5pJ95T/5bxO/m54p4MtgVEwKNev1u/BUjrpWAUMZPW0Kz2RWP8v;86054c036fe3bf0991bd9a9da1a8d44dd130c6508602215e50bb1e385326779d' |
| 813 | } |
| 814 | } |
| 815 | |
| 816 | /** |
| 817 | * 获取url参数值 |