From 22f9e1efd4c77a2c665d2e3e2c84c25e6ae775d4 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期四, 21 十二月 2023 17:07:01 +0800
Subject: [PATCH] 销售明细单 销售机会,销售报价单根据接口获取的配置判断是否必填的功能+按钮禁止点击的样式修改

---
 src/components/layout/components/appHeader/index.vue |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/src/components/layout/components/appHeader/index.vue b/src/components/layout/components/appHeader/index.vue
index 3eaf269..44f019b 100644
--- a/src/components/layout/components/appHeader/index.vue
+++ b/src/components/layout/components/appHeader/index.vue
@@ -29,6 +29,28 @@
     this.username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1")
   },
   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.113:8080`
+      }
+      return loginPathMap[this.environmentType()]
+    },
     handleCommand(command) {
       console.log(command)
       if (command === "logout") {
@@ -41,7 +63,8 @@
         })
           .then(() => {
             Cookies.remove("token")
-            window.location.href = "http://localhost:8080/login" //鏈湴鐨勬櫤鎱у伐鍘�-鐧诲綍椤�
+            // window.location.href = 'http://localhost:8080/login'; //鏈湴鐨勬櫤鎱у伐鍘�-鐧诲綍椤�
+            window.location.href = "http:" + this.getApsPage() + "/login"
             this.$message({
               type: "success",
               message: "娉ㄩ攢鎴愬姛!"

--
Gitblit v1.8.0