zhongrj
2026-06-02 1dbc6ed10458201d22e7f47a7da36f75f0ebf257
src/views/layout/index.vue
@@ -10,6 +10,10 @@
-->
<template>
    <div class="wrapper">
        <div class="logout-btn" @click="handleLogout">
            <i class="el-icon-logout"></i>
            <span>退出登录</span>
        </div>
        <map-box ref="modalForm" :curMap="curMap" @getsearchSKValList="getsearchSKValList($event)">
            <!-- 主体内容区域 -->
            <div slot="mainContent" class="main-content" id="MainContent">
@@ -134,6 +138,7 @@
<script>
import { getSignSituationList, getExamScoreList, getExamList, getLatestExam } from "@/api/home/index"
import { logout } from "@/api/user"
import { EventBus } from "@/utils/EventBus"
@@ -453,6 +458,28 @@
        handleVideoClose () {
            this.$store.commit("SET_ISSHOWVIDEODIALOG", false)
        },
        handleLogout () {
            this.$confirm('确定要退出登录吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                logout().then(() => {
                    this.$store.commit('SET_TOKEN', '')
                    this.$store.commit('SET_USER_INFO', {})
                    localStorage.removeItem('token')
                    localStorage.removeItem('userInfo')
                    this.$router.push({ path: '/login' })
                }).catch(() => {
                    this.$store.commit('SET_TOKEN', '')
                    this.$store.commit('SET_USER_INFO', {})
                    localStorage.removeItem('token')
                    localStorage.removeItem('userInfo')
                    this.$router.push({ path: '/login' })
                })
            }).catch(() => {})
        }
    }
}
@@ -463,7 +490,38 @@
    position: relative;
    width: 100vw;
    height: 100vh;
    // border: 1px solid white;
    .logout-btn {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 9999;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 25px;
        color: #fff;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.3s ease;
        &:hover {
            background: rgba(255, 255, 255, 0.25);
            border-color: rgba(255, 255, 255, 0.5);
            transform: translateY(-2px);
        }
        &:active {
            transform: translateY(0);
        }
        i {
            font-size: 16px;
        }
    }
    #MainContent {
        position: absolute;