From 1445c7e1f76c4628f4619cf67150a63d6f8f5e90 Mon Sep 17 00:00:00 2001
From: mg <maokecheng@163.com>
Date: 星期二, 01 十一月 2022 09:04:16 +0800
Subject: [PATCH] Merge branch 'master' of http://42.193.1.25:9521/r/sccg_ui

---
 src/views/login/index.vue |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 81992e8..0da15ac 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,9 +116,9 @@
     },
     ...mapActions(["login"]),
     handleLogin() {
-      console.log("in login");
       const { username, password } = this.loginForm;
       const that = this;
+      console.log(this.login);
       this.$axios
         .post("sccg/admin/login", {
           password,
@@ -119,17 +126,23 @@
         })
         .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
+                })
               }
             })
           }
@@ -163,6 +176,10 @@
   top: 20%;
   right: 5%;
   width: 360px;
+  &:deep(.el-input__inner){
+    background-color: #fff !important;
+    border: 1px solid #dcdfe6 !important;
+  }
 }
 
 .text {
@@ -177,6 +194,7 @@
   .logo>img {
     width: 75px;
     height: 75px;
+    border-radius: 4px;
   }
 
   .text-r {

--
Gitblit v1.8.0