charles
2024-07-18 059f2a762ac88bb7ec20454a455b4ed2d43877b3
src/components/layout/components/appHeader/index.vue
@@ -22,6 +22,7 @@
<script>
import Cookies from "js-cookie"
import UpdatePassWord from "./components/updatePassWord"
import {getApsPage} from '@/common/untils/index.js'
export default {
  name: "SalesLead",
  props: {
@@ -65,7 +66,7 @@
      return type
    },
    getApsPage() {
   /* getApsPage() {
      // 首页部署在各个环境的端口
      const loginPathMap = {
        prod: `//${window.location.hostname}:9080`,
@@ -74,9 +75,8 @@
        dev: `//192.168.8.117:8080`
      }
      return loginPathMap[this.environmentType()]
    },
    },*/
    handleCommand(command) {
      console.log(command)
      if (command === "logout") {
        // this.$router.push({ path: "/login" })
        document.cookie = "cookieName=; path=/;"
@@ -88,11 +88,14 @@
          .then(() => {
            Cookies.remove("token")
            // window.location.href = 'http://localhost:8080/login'; //本地的智慧工厂-登录页
            window.location.href = "http:" + this.getApsPage() + "/login"
            //window.location.href = "http:" + this.getApsPage() + "/login"
            this.$message({
              type: "success",
              message: "注销成功!"
            })
              setTimeout(()=>{
                  window.open(`//${getApsPage()}/login`);
              },500);
          })
          .catch(() => {
            this.$message({