From 664cae654867b528ea339f187ebe290cb04d6fcf Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期四, 27 八月 2026 18:41:21 +0800
Subject: [PATCH] docs: 关机前交接——运行状态、待验证项、外置配置要点

---
 traffic-audit-web/src/components/AppHeader.vue |   65 ++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/traffic-audit-web/src/components/AppHeader.vue b/traffic-audit-web/src/components/AppHeader.vue
new file mode 100644
index 0000000..09eb2bb
--- /dev/null
+++ b/traffic-audit-web/src/components/AppHeader.vue
@@ -0,0 +1,65 @@
+<template>
+  <el-header class="app-header">
+    <span class="header-title">{{ title }}</span>
+    <div class="header-right">
+      <span class="header-user">
+        <i class="el-icon-user"></i> {{ username }}
+      </span>
+      <el-button type="text" class="header-logout" @click="logout">
+        <i class="el-icon-switch-button"></i> 閫�鍑虹櫥褰�
+      </el-button>
+    </div>
+  </el-header>
+</template>
+
+<script>
+export default {
+  name: 'AppHeader',
+  props: {
+    title: { type: String, required: true }
+  },
+  computed: {
+    username() {
+      return localStorage.getItem('username') || 'admin'
+    }
+  },
+  methods: {
+    logout() {
+      this.$confirm('纭畾閫�鍑虹櫥褰曞悧锛�', '鎻愮ず', {
+        confirmButtonText: '閫�鍑�',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        localStorage.removeItem('token')
+        localStorage.removeItem('username')
+        this.$message.success('宸查��鍑虹櫥褰�')
+        this.$router.push('/login')
+      }).catch(() => {})
+    }
+  }
+}
+</script>
+
+<style scoped>
+.app-header {
+  background: #409EFF;
+  color: #fff;
+  line-height: 60px;
+  font-size: 18px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 0 20px;
+  flex-shrink: 0;
+}
+.header-right {
+  display: flex;
+  align-items: center;
+  gap: 12px;
+  font-size: 14px;
+  line-height: normal;
+}
+.header-user { opacity: 0.92; }
+.header-logout { color: #fff; font-size: 14px; padding: 0; }
+.header-logout:hover { color: #ffd04b; }
+</style>
\ No newline at end of file

--
Gitblit v1.9.1