From f3a89a121bc426ba522635835a0fb159a84a8f06 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期二, 07 十一月 2023 10:49:05 +0800
Subject: [PATCH] 库存报表跳转补货

---
 src/components/layout/components/appHeader/index.vue |   64 +++++++++++++++++++++++++++-----
 1 files changed, 54 insertions(+), 10 deletions(-)

diff --git a/src/components/layout/components/appHeader/index.vue b/src/components/layout/components/appHeader/index.vue
index e83742e..673e5be 100644
--- a/src/components/layout/components/appHeader/index.vue
+++ b/src/components/layout/components/appHeader/index.vue
@@ -2,18 +2,19 @@
   <div class="sales-lead">
     <div class="header-title">{{ headerTitle }}</div>
     <div class="header-user-info">
-      <!-- <div class="avatar"><el-avatar icon="el-icon-user-solid"></el-avatar></div>
+      <div class="avatar"><el-avatar icon="el-icon-user-solid"></el-avatar></div>
       <el-dropdown @command="handleCommand">
         <div class="el-dropdown-link">鐢ㄦ埛鍚�<i class="el-icon-arrow-down el-icon--right"></i></div>
         <el-dropdown-menu slot="dropdown">
           <el-dropdown-item command="logout">閫�鍑�</el-dropdown-item>
         </el-dropdown-menu>
-      </el-dropdown> -->
+      </el-dropdown>
     </div>
   </div>
 </template>
 
 <script>
+import Cookies from "js-cookie"
 export default {
   name: "SalesLead",
   props: {
@@ -23,10 +24,50 @@
     return {}
   },
   methods: {
+    environmentType(){
+      let type
+      if (location.href.includes('192.168.20.119')) {
+          type = 'test'
+      } else if (location.href.includes('192.168') || location.href.includes('localhost')) {
+          type = 'dev'
+      } else {
+          type = 'prod'
+      }
+      return type
+    },
+    getApsPage(){
+      // 棣栭〉閮ㄧ讲鍦ㄥ悇涓幆澧冪殑绔彛
+      const loginPathMap = {
+          prod:`//${window.location.hostname}:9080`,
+          test:`//192.168.20.119:9080`,
+          // 鎯宠烦鍒版湰鍦板惎鍔ㄧ殑鐧诲綍椤电殑璇濋渶瑕佹妸dev鏀规垚浣犳湰鍦伴」鐩矾寰�
+          dev: `//192.168.8.112:8082`
+      }
+      return loginPathMap[this.environmentType()]
+    },
     handleCommand(command) {
       console.log(command)
       if (command === "logout") {
-        this.$router.push({ path: "/login" })
+        // this.$router.push({ path: "/login" })
+        document.cookie = "cookieName=; path=/;";
+        this.$confirm('纭畾瑕佹敞閿�褰撳墠鐢ㄦ埛鍚�?', '娉ㄩ攢鐢ㄦ埛', {
+          confirmButtonText: '纭畾',
+          cancelButtonText: '鍙栨秷',
+          type: 'warning'
+        }).then(() => {
+          Cookies.remove('token')
+          // window.location.href = 'http://localhost:8080/login'; //鏈湴鐨勬櫤鎱у伐鍘�-鐧诲綍椤�
+          window.location.href = 'http:'+this.getApsPage()+'/login'; 
+          this.$message({
+            type: 'success',
+            message: '娉ㄩ攢鎴愬姛!'
+          });
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '宸插彇娑堟敞閿�'
+          });          
+        });
       }
     }
   }
@@ -37,15 +78,18 @@
 <style lang="scss" scoped>
 .sales-lead {
   display: flex;
-  height: 55px;
-  line-height: 55px;
-  background-color: #fff;
-  margin-bottom: 10px;
-  margin-left: -10px;
+  height: 50px;
+  line-height: 50px;
+  flex-shrink: 0;
+  box-sizing: border-box;
+  background-color: transparent;
+  border: 1px solid #ccc;
+  align-items: center;
   .header-title {
     margin-left: 16px;
-    font-size: 16px;
-    color: #475059;
+    font-size: 18px;
+    font-weight: 700;
+    color: #171718;
   }
   .header-user-info {
     margin-left: auto;

--
Gitblit v1.8.0