Sfoglia il codice sorgente

fix: 手工数据导入无法解密

Karsa 11 mesi fa
parent
commit
4d2f684463

+ 1 - 0
src/utils/parseData.js

@@ -2,6 +2,7 @@ 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))

+ 7 - 1
src/views/dataEntry_manage/components/insertData.vue

@@ -138,7 +138,13 @@ export default {
     },
     // 上传成功之后
     handleSuccess(result) {
-      let res = this.$parseData(result);
+      //兼容下结构
+      let res = this.$parseData({
+        headers: {
+          dk: sessionStorage.getItem('dk')||""
+        },
+        data: result
+      });
       if (res.Ret === 200) {
         // 0成功 1部分失败 -1全部失败
         let str = `