Procházet zdrojové kódy

fix:解密bug修改

zhaojijng před 2 roky
rodič
revize
f612167c7e

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/sgdaping/assets/background.473f0e94.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/sgdaping/assets/index.a15404b0.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/sgdaping/assets/index.74aa9f0e.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 12 - 12
dist/sgdaping/assets/index.0bde5d9f.js


+ 1 - 1
dist/sgdaping/assets/index.b4cd9a4b.js

@@ -1 +1 @@
-import{i as e,r as n,o,l as t,_ as s,a as r,g as a}from"./index.0bde5d9f.js";const c=e({setup(){return t(),n({}),o(()=>{}),{}}});function u(p,i,_,l,d,f){return a(),r("h2",null,"login\u9875\u9762")}const x=s(c,[["render",u]]);export{x as default};
+import{i as e,r as n,o,l as t,_ as s,a as r,g as a}from"./index.d44446e6.js";const c=e({setup(){return t(),n({}),o(()=>{}),{}}});function u(p,i,_,l,d,f){return a(),r("h2",null,"login\u9875\u9762")}const x=s(c,[["render",u]]);export{x as default};

+ 1 - 1
dist/sgdaping/index.html

@@ -5,7 +5,7 @@
     <link rel="icon" type="image/svg+xml" href="/sgdaping/vite.svg" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>daping</title>
-    <script type="module" crossorigin src="/sgdaping/assets/index.0bde5d9f.js"></script>
+    <script type="module" crossorigin src="/sgdaping/assets/index.d44446e6.js"></script>
     <link rel="stylesheet" href="/sgdaping/assets/index.c910de97.css">
   </head>
   <body>

+ 9 - 7
src/router/index.ts

@@ -4,7 +4,7 @@ import {
     createWebHashHistory,
 } from "vue-router";
 import { setRem } from "@/utils/rem";
-import { Encrypt, Decrypt } from "@/utils/crypto";
+import { Encrypt, Decrypt, deal_locationsearch } from "@/utils/crypto";
 
 const history = createWebHistory("/sgdaping/");
 const routes = [
@@ -34,20 +34,22 @@ const router = createRouter({
 });
 
 import useProjectStore from "@/store/useProjectStore";
+
 router.beforeEach(async (to, from, next) => {
     // canUserAccess() 返回 `true` 或 `false`
 
-    //debugger;
-    var projectId = to.query.projectId || "";
+    //var projectId = to.query.projectId || "";
+    var dealRes = deal_locationsearch();
+    var projectId = dealRes[0];
     var projectId2;
-    // var xxx = Encrypt("Pj1101020002");
-    // xxx && console.log("xxxx", xxx);
+    //var xxx = Encrypt("Pj1101050043");
+    //console.log("xxxx",dealRes);
 
     projectId && (projectId2 = Decrypt(projectId));
-   
+
     const projectStore = useProjectStore();
     projectId2 && projectStore.setProjectId(projectId2);
-
+    //debugger;
     await projectStore.setWeather();
     await projectStore.setProjectObj();
     await projectStore.setLastAllEnergy();

+ 17 - 0
src/utils/crypto.ts

@@ -35,3 +35,20 @@ export function Decrypt(word: any) {
     });
     return CryptoJS.enc.Utf8.stringify(decrypt).toString();
 }
+
+export function deal_locationsearch() {
+    var search = location.search.substring(1).split("&"); //初步处理数据-->去掉?分开多个键值对
+
+    var key = []; //键数组
+    var keyvalue = []; //值数组
+    for (var i = 0; i < search.length; i++) {
+        //var pos = search[i].split("=");
+        //debugger;
+        var index = search[i].indexOf("=");
+        var val = search[i].substring(index+1);
+        // key.push(pos[0]);
+        keyvalue.push(val);
+    } 
+
+    return keyvalue; //最终返回值为对象
+}