Browse Source

生产数据解密

yujinwen 6 days ago
parent
commit
ff787c3084
1 changed files with 6 additions and 7 deletions
  1. 6 7
      src/utils/parseData.js

+ 6 - 7
src/utils/parseData.js

@@ -1,12 +1,11 @@
 import ParserData from '@/api/crypto.js';
 /* 解密数据处理 */
 export function parseData(response) {
-  // const headKeyStr=response.headers.dk
-  // sessionStorage.setItem('dk',headKeyStr);
-  // const desKey=ParserData.Des3Decrypt(headKeyStr,'JMCqSoUrTAmyNNIRb0TtlrPk')
-  // let result = process.env.NODE_ENV == "production"
-  // ? JSON.parse(ParserData.Des3Decrypt(response.data,desKey))
-  // : response.data;
-  let result=response.data
+  const headKeyStr=response.headers.dk
+  sessionStorage.setItem('dk',headKeyStr);
+  const desKey=ParserData.Des3Decrypt(headKeyStr,'JMCqSoUrTAmyNNIRb0TtlrPk')
+  let result = process.env.NODE_ENV == "production"
+  ? JSON.parse(ParserData.Des3Decrypt(response.data,desKey))
+  : response.data;
   return result
 }