li.shaoyi há 3 anos atrás
pai
commit
53f3ae902c
1 ficheiros alterados com 1 adições e 8 exclusões
  1. 1 8
      src/utils/websocket/crypto/index.ts

+ 1 - 8
src/utils/websocket/crypto/index.ts

@@ -167,15 +167,8 @@ export const decryptAES = (value: string): string | undefined => {
     });
 
     const decrytped = CryptoJS.AES.decrypt(cipherParams, uint8ArrayToWordArray(key), aesOption);
-
-    let h = wordArrayToUint8Array(decrytped);
-    const index = h.findIndex(item => item == 4);
-    if (index !== -1) {
-        h = h.subarray(0, index - 1);
-    }
-
+    const h = wordArrayToUint8Array(decrytped).subarray(0, decrytped.words.length * 4 - 1);
     const result = new TextDecoder().decode(h);
-    debugger
     return result;
 };