src/components/layout/components/appHeader/index.vue
@@ -18,7 +18,6 @@
</template>
<script>
import Cookies from "js-cookie"
import UpdatePassWord from "./components/updatePassWord"
export default {
  name: "SalesLead",
@@ -38,17 +37,14 @@
    }
  },
  created() {
    const userObj = Cookies.get("userObj")
    if (userObj) {
      let userInfo = JSON.parse(userObj)
      this.editConfig.userId = userInfo.id
      this.username = userInfo.nickName
    } else {
      console.log("Object not found in cookie")
    }
    console.log(localStorage, "dddd")
  },
  mounted() {
    // this.username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1")
    console.log(localStorage, "mounted")
    console.log(localStorage)
    this.editConfig.userId = localStorage.getItem("uuid")
    this.username = localStorage.getItem("username")
  },
  methods: {
    environmentType() {
@@ -83,9 +79,12 @@
          type: "warning"
        })
          .then(() => {
            Cookies.remove("token")
            // Cookies.remove("token")
            // window.location.href = 'http://localhost:8080/login'; //本地的智慧工厂-登录页
            // window.location.href = "http:" + this.getApsPage() + "/login"
            localStorage.removeItem("token")
            localStorage.removeItem("uuid")
            localStorage.removeItem("username")
            // 跳转路由
            this.$router.push({ path: "/login" })
            this.$message({