From ad620c9926ab7f1e7dc3c3a73445ce88a3d830b3 Mon Sep 17 00:00:00 2001
From: xuhuihui <3548508071@qq.com>
Date: Mon, 6 Dec 2021 10:31:15 +0800
Subject: [PATCH] commit

---
 04.系统编码/Frontend/.idea/workspace.xml      | 6 ++++--
 04.系统编码/Frontend/src/App.vue              | 6 ++++++
 04.系统编码/Frontend/src/components/Login.vue | 4 ++--
 04.系统编码/Frontend/src/uilts/axios.ts       | 4 ++--
 04.系统编码/Frontend/src/uilts/storage.ts     | 5 +++--
 5 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/04.系统编码/Frontend/.idea/workspace.xml b/04.系统编码/Frontend/.idea/workspace.xml
index bfa6c9e..c15bfa6 100644
--- a/04.系统编码/Frontend/.idea/workspace.xml
+++ b/04.系统编码/Frontend/.idea/workspace.xml
@@ -3,8 +3,8 @@
   <component name="ChangeListManager">
     <list default="true" id="4b7d7b72-f5b8-41e4-85d5-6267bdc12fc5" name="默认变更列表" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/components/Shared/Header.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/Shared/Header.vue" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/router/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/router/index.ts" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/App.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/App.vue" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/components/Login.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/Login.vue" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/uilts/axios.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/uilts/axios.ts" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/uilts/storage.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/uilts/storage.ts" afterDir="false" />
     </list>
@@ -87,6 +87,8 @@
       <workItem from="1638496246090" duration="1527000" />
       <workItem from="1638497917929" duration="12367000" />
       <workItem from="1638515445129" duration="7072000" />
+      <workItem from="1638524838907" duration="8000" />
+      <workItem from="1638752962691" duration="4827000" />
     </task>
     <task id="LOCAL-00001" summary="2021 12 01">
       <created>1638357539757</created>
diff --git a/04.系统编码/Frontend/src/App.vue b/04.系统编码/Frontend/src/App.vue
index 887302c..41a462e 100644
--- a/04.系统编码/Frontend/src/App.vue
+++ b/04.系统编码/Frontend/src/App.vue
@@ -7,6 +7,7 @@
     import { onMounted, reactive, ref, toRefs, watch } from 'vue';
     import { useRouter } from 'vue-router';
     import Header from './components/Shared/Header.vue';
+    import {clear} from "./uilts/storage";
 
     export default {
         name: 'App',
@@ -18,6 +19,9 @@
             onMounted(() => {
                 getRem(1920, 100);
                 window.onresize = () => getRem(1920, 100);
+                window.onbeforeunload = () => {
+                  clear()
+                }
             })
 
             watch(() => router.currentRoute.value.path,
@@ -32,6 +36,8 @@
                 html.style.fontSize = oWidth / pwidth*prem + "px";
             }
 
+
+
             return {showHeader}
         }
     }
diff --git a/04.系统编码/Frontend/src/components/Login.vue b/04.系统编码/Frontend/src/components/Login.vue
index 181c6ec..c1c7497 100644
--- a/04.系统编码/Frontend/src/components/Login.vue
+++ b/04.系统编码/Frontend/src/components/Login.vue
@@ -23,7 +23,7 @@ import {reactive, toRefs} from "vue";
 import { post } from "./../uilts/axios";
 import { useRouter } from "vue-router"
 import { ElMessage } from 'element-plus'
-import { setStaff } from "../uilts/storage";
+import { setStaff,guid } from "../uilts/storage";
 
 export default {
   name: 'Login',
@@ -62,7 +62,7 @@ export default {
               type: 'error'
             });
           }else {
-            setStaff('login_staff', res.data)
+            setStaff('login_staff', guid())
             router.push("/MicrowaveRadiation")
           }
         })
diff --git a/04.系统编码/Frontend/src/uilts/axios.ts b/04.系统编码/Frontend/src/uilts/axios.ts
index 47d73f7..dcbef21 100644
--- a/04.系统编码/Frontend/src/uilts/axios.ts
+++ b/04.系统编码/Frontend/src/uilts/axios.ts
@@ -5,8 +5,8 @@ import { ElLoading } from 'element-plus'
 
 let loading = null;
 const service = axios.create({
-    // baseURL:"http://112.124.40.88:8002",
-    baseURL:"",
+    baseURL:"http://112.124.40.88:8002",
+    // baseURL:"",
     timeout: 500000
 })
 
diff --git a/04.系统编码/Frontend/src/uilts/storage.ts b/04.系统编码/Frontend/src/uilts/storage.ts
index fc707f7..dd9bae2 100644
--- a/04.系统编码/Frontend/src/uilts/storage.ts
+++ b/04.系统编码/Frontend/src/uilts/storage.ts
@@ -1,13 +1,14 @@
 
-function guid() {
+export function guid() {
     return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
         var r = Math.random() * 16 | 0,
             v = c == 'x' ? r : (r & 0x3 | 0x8);
         return v.toString(16);
     });
 }
+
 export function setStaff(key: any, staff: any) {
-    localStorage.setItem(key, guid());
+    localStorage.setItem(key, JSON.stringify(staff));
 }
 
 export function getStaff(key: any) {