|
@@ -56,33 +56,19 @@ export default {
|
|
|
getUrl() {
|
|
|
let url = window.location.href
|
|
|
let p = url.split('?')[1].split('#')[0]
|
|
|
+ console.log('p=',p);
|
|
|
+ if(p.slice(-1) == '=') {
|
|
|
+ p = p.slice(0,-1)
|
|
|
+ }
|
|
|
var privateKey = "02487CCB5C46B750B21D753A70953A03D9A894C4085CF6ED94E8A6396F3436E1";
|
|
|
var encrText = p;
|
|
|
const cipherMode = 1
|
|
|
let decryptData = sm2.doDecrypt(encrText, privateKey, cipherMode) // 解密结果
|
|
|
p = decryptData
|
|
|
- /* var key = CryptoJS.enc.Utf8.parse('1463587320654321'); //为了避免补位,直接用16位的秘钥
|
|
|
- var iv = CryptoJS.enc.Utf8.parse('1758326540123456'); //16位初始向量
|
|
|
- var encrypted = CryptoJS.AES.decrypt(p, key, {
|
|
|
- iv: iv,
|
|
|
- mode:CryptoJS.mode.CBC,
|
|
|
- padding:CryptoJS.pad.Pkcs7
|
|
|
- });
|
|
|
- p = encrypted.toString(CryptoJS.enc.Utf8) */
|
|
|
-
|
|
|
-
|
|
|
- /* let keyValue = p
|
|
|
- let obj = {}
|
|
|
- for(var i=0;i<keyValue.length;i++) {
|
|
|
- let item = keyValue[i].split('=');
|
|
|
- let key = item[0];
|
|
|
- let value = item[1];
|
|
|
- obj[key] = value;
|
|
|
- } */
|
|
|
-
|
|
|
-
|
|
|
+ console.log('p=',p);
|
|
|
+ console.log('p=',p);
|
|
|
let id = p.split('=')[1];
|
|
|
- console.log(id);
|
|
|
+ console.log('id=',id);
|
|
|
window.localStorage.setItem('id',id)
|
|
|
|
|
|
// return decryptData ;
|