From e1b028d486713eaf55aaf35fbf334aa568059c0d Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期二, 14 四月 2026 15:46:54 +0800
Subject: [PATCH] 项目复制

---
 src/views/components/logout.vue |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/src/views/components/logout.vue b/src/views/components/logout.vue
new file mode 100644
index 0000000..d6e8606
--- /dev/null
+++ b/src/views/components/logout.vue
@@ -0,0 +1,57 @@
+<template>
+  <el-dialog
+    v-model="dialogFlag"
+    title="鎻愮ず"
+    width="500"
+    align-center
+  >
+    <span>鏄惁閫�鍑虹櫥褰曪紵</span>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button @click="dialogFlag = false">鍙栨秷</el-button>
+        <el-button type="primary" @click="confirm()">
+          纭畾
+        </el-button>
+      </div>
+    </template>
+  </el-dialog>
+</template>
+<script>
+import { useSessionStore } from '@/stores/session.js'
+import { storeToRefs } from 'pinia';
+
+export default {
+  setup() {
+    const { resetUserInfo } = useSessionStore()
+    return { resetUserInfo }
+  },
+  data() {
+    return {
+      dialogFlag: false
+    }
+  },
+  props: {
+    modelValue: {
+      type: Boolean,
+      default: false
+    }
+  },
+  watch: {
+    modelValue(val) {
+      this.dialogFlag = val
+    },
+    dialogFlag(val) {
+      this.$emit('update:modelValue', val)
+    }
+  },
+  methods: {
+    confirm() {
+      this.dialogFlag = false
+      this.$router.replace('/auth/login')
+      this.resetUserInfo()
+      localStorage.removeItem('dictData')
+      this.$axios.post('/system/auth/logout')
+    }
+  }
+}
+</script>

--
Gitblit v1.8.0