shuishen
2024-01-24 d16d10d94fddff86bdfd87113e7fd2cebe8b7cd7
src/page/index/top/index.vue
@@ -67,7 +67,7 @@
                    <i :class="isFullScren ? 'icon-tuichuquanping' : 'icon-quanping'" @click="handleScreen"></i>
                </div>
            </el-tooltip>
            <img class="top-bar__img" :src="userInfo.avatar">
            <img class="top-bar__img" :src="topBarImg">
            <el-dropdown>
                <span class="el-dropdown-link">
                    {{ userInfo.userName }}
@@ -94,6 +94,7 @@
    </div>
</template>
<script>
import { getStore } from "@/util/store"
import { setTheme } from "@/util/util"
import { resetRouter } from '@/router/router'
import { mapGetters, mapState } from "vuex"
@@ -121,6 +122,7 @@
    name: "top",
    data () {
        return {
            webType: getStore({ name: "webType" }),
            searchShow: false,
            userBox: false,
            userForm: {
@@ -168,7 +170,9 @@
                        }],
                    },
                ]
            }
            },
            showMenu: getStore({ name: "showMenu" }),
            globalUserInfo: getStore({ name: "userInfo" }),
        }
    },
    filters: {},
@@ -186,7 +190,6 @@
            showFullScren: state => state.common.showFullScren,
            showCollapse: state => state.common.showCollapse,
            showSearch: state => state.common.showSearch,
            showMenu: state => state.common.showMenu,
            showColor: state => state.common.showColor
        }),
        ...mapGetters([
@@ -198,7 +201,14 @@
            "tag",
            "logsLen",
            "logsFlag"
        ])
        ]),
        topBarImg () {
            if (this.userInfo.avatar.indexOf('upload') != -1) {
                return this.website.minioUrl + this.userInfo.avatar
            } else {
                return this.userInfo.avatar
            }
        }
    },
    methods: {
        handleScreen () {
@@ -235,7 +245,13 @@
            }).then(() => {
                this.$store.dispatch("LogOut").then(() => {
                    resetRouter()
                    this.$router.push({ path: "/login" })
                    if (this.webType == 'default') {
                        this.$router.push({ path: "/login" })
                    } else {
                        this.$router.push({ path: "/tenementLogin" })
                    }
                })
            })
        }