From 2bb0e066fdc522beb51dd13f6a72cd67bd5d6a58 Mon Sep 17 00:00:00 2001
From: “dzb” <2632970487@qq.com>
Date: 星期日, 09 十月 2022 18:06:46 +0800
Subject: [PATCH] 修改bug,店铺管理新增、查询

---
 src/views/login/index.vue |   31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index d33b057..3418821 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -4,7 +4,7 @@
     <div class="text">
       <div class="logo">
         <img
-          src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__155eeb2ceaac89ec717869a050964a36.svg"
+          :src="imgUrl"
           alt="">
       </div>
       <div class="text-r">
@@ -80,6 +80,7 @@
         // username: "admin",
         // password: "macro123",
       },
+      imgUrl:'',
       loginRules: {
         username: [
           { required: true, trigger: "blur", validator: validateUsername },
@@ -92,7 +93,19 @@
       pwdType: false,
     };
   },
-  created() { },
+  created() {
+    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: {
     showPwd() {
       if (!this.pwdType) {
@@ -103,7 +116,6 @@
     },
     ...mapActions(["login"]),
     handleLogin() {
-      console.log("in login");
       const { username, password } = this.loginForm;
       const that = this;
       this.$axios
@@ -113,17 +125,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
+                })
               }
             })
           }
@@ -171,6 +189,7 @@
   .logo>img {
     width: 75px;
     height: 75px;
+    border-radius: 4px;
   }
 
   .text-r {

--
Gitblit v1.8.0