From de2fb1b4f32f0c1fa0ce1df7b6c009e070a7b775 Mon Sep 17 00:00:00 2001
From: pengjun <158915633@qq.com>
Date: Thu, 7 Sep 2023 14:37:37 +0800
Subject: [PATCH] login
---
 src/views/login/Login.vue | 53 ++++++++++++++-------------------------
 1 file changed, 19 insertions(+), 34 deletions(-)
diff --git a/src/views/login/Login.vue b/src/views/login/Login.vue
index 64a8bb4..7cf401a 100644
--- a/src/views/login/Login.vue
+++ b/src/views/login/Login.vue
@@ -4,30 +4,14 @@
       
         系统登录
         
-          
+          
             
-              
+              
             
             
-              
+              
             
-            用户登录
+            用户登录
           
         
        
@@ -75,25 +59,26 @@ export default {
           })
             .then((res) => {
               msgs = res.data.msg;
-              if(res.code==1){
-                     writetoken(res.data.expires_in);
-              window.localStorage.setItem("token", res.data.access_token);
-              window.localStorage.setItem(
-                "refresh_token",
-                res.data.refresh_token
-              );
-              window.localStorage.setItem("tokentype", res.data.token_type);
-              window.localStorage.setItem("user", this.form.Username);
+              if (res.code == 1) {
+                window.sessionStorage.setItem("peisid", res.data.peisid); //设置当前人员所属体检中心
+                writetoken(res.data.expires_in);
+                window.localStorage.setItem("token", res.data.access_token);
+                window.localStorage.setItem(
+                  "refresh_token",
+                  res.data.refresh_token
+                );
+                window.localStorage.setItem("tokentype", res.data.token_type);
+                window.localStorage.setItem("user", this.form.Username);
 
-              this.$router.push({ path: "home" });
-              this.$store.state.changepassword = this.form.Password;
+                this.$router.push({ path: "home" });
+                this.$store.state.changepassword = this.form.Password;
               }
               this.$message.success(msgs);
 
-              console.log(res,'res');
+              console.log(res, 'res');
               // if (res.code != -1 && res.data.code == 1) {
               //   window.sessionStorage.setItem("peisid", res.data.peisid); //设置当前人员所属体检中心
-           
+
 
               //   return this.$axios.post(
               //     mm.apiurl + "/connect/token",
@@ -127,7 +112,7 @@ export default {
             //   this.$router.push({ path: "home" });
             //   this.$store.state.changepassword = this.form.Password;
             // })
-            .catch((err) => {});
+            .catch((err) => { });
 
           //   console.log(res);
           //   if (res.data.code == 1 && res.code == 1) {