From 1c0bb2817007566179ada20ae740018ba6a9615a Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期四, 17 十一月 2022 17:40:16 +0800
Subject: [PATCH] Merge branch 'master' of http://42.193.1.25:9521/r/sccg_ui

---
 src/views/login/index.vue |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 81992e8..2d699af 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -94,9 +94,16 @@
     };
   },
   created() {
-    const pic = JSON.parse(localStorage.getItem('pic'));
+    const pic = JSON.parse(sessionStorage.getItem('pic'));
     if(pic){
       this.imgUrl = pic.loginPageIconUrl
+    }else{
+      this.$axios({
+          method: 'get',
+          url: 'sccg/system/portal/logo/search',
+        }).then(res => {
+          this.imgUrl = res.data.loginPageIconUrl
+        })
     }
    },
   methods: {
@@ -109,7 +116,6 @@
     },
     ...mapActions(["login"]),
     handleLogin() {
-      console.log("in login");
       const { username, password } = this.loginForm;
       const that = this;
       this.$axios
@@ -119,24 +125,27 @@
         })
         .then(function (response) {
           if (response.code === 200) {
+            // 璁剧疆toke鏃堕棿
             // 淇濆瓨token
-            console.log(response);
-            localStorage.setItem('token',response.data.token);
+            sessionStorage.setItem('token',response.data.token);
             // 淇濆瓨token
-            localStorage.setItem('tokenHead',response.data.tokenHead)
+            sessionStorage.setItem('tokenHead',response.data.tokenHead);
+            // 淇濆瓨鐢ㄦ埛鐧诲綍鍚�
+            sessionStorage.setItem('name',username);
             // 璺宠浆鍒伴椤�
             that.$router.push("/home");
           }else{
             that.$refs.loginForm.validate((valid)=>{
               if(valid){
-                that.$message.error(response.data.message);
+                that.$message({
+                  type:'warning',
+                  message:response.message
+                })
               }
             })
           }
-          // console.log(response);
         })
         .catch(function (error) {
-          console.log(error);
         });
     },
   },
@@ -163,6 +172,10 @@
   top: 20%;
   right: 5%;
   width: 360px;
+  &:deep(.el-input__inner){
+    background-color: #fff !important;
+    border: 1px solid #dcdfe6 !important;
+  }
 }
 
 .text {
@@ -177,6 +190,7 @@
   .logo>img {
     width: 75px;
     height: 75px;
+    border-radius: 4px;
   }
 
   .text-r {

--
Gitblit v1.8.0