31d6306e3b
=== 后端核心 === - db_helper: 统一数据库访问抽象层 - system.py API: * 参数绑定修复: 使用 Body(embed=True) 接收 JSON * 添加请求日志记录 - sync.py: 仅导出 DB→JSON(备份) === 合规与流水线 === - compliance_checker: 标签检测优化(仅检查容器,避免正文误判) - 所有脚本(creator/collector/writer/outline/research等)统一使用数据库 === 前端改版 === - topics.html: * 创作/优化 API 路径修正 * 预览弹窗重设计:多平台并行加载、富文本显示、单复制按钮 * 状态中文映射(getStatusLabel) * 认证检查 - 所有 HTML 静态资源路径修复(移除 /static 前缀) === 数据一致性 === - 数据库状态统一为英文(pending/review/ready/published) - 前端显示中文化映射 已测试 A03 流水线完整通过。
602 lines
25 KiB
HTML
602 lines
25 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>宇之然内容创作平台</title>
|
|
<link rel="stylesheet" href="element-plus.css">
|
|
<style>
|
|
/* 深色渐变背景主题 */
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body {
|
|
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #f5f7fa; color: #303133; }
|
|
/* 深色渐变: #1a1a2e → #16213e → #0f3460 */
|
|
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
|
|
min-height: 100vh;
|
|
color: #e0e6ed;
|
|
}
|
|
|
|
/* 导航栏 */
|
|
.navbar {
|
|
background: rgba(102, 126, 234, 0.15);
|
|
backdrop-filter: blur(20px);
|
|
border-bottom: 1px solid rgba(102, 126, 234, 0.2);
|
|
padding: 16px 24px;
|
|
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
}
|
|
.navbar-content {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
max-width: 1400px;
|
|
margin: 0 auto;
|
|
}
|
|
.navbar-title {
|
|
font-size: 20px;
|
|
font-weight: 700;
|
|
background: linear-gradient(90deg, #667eea, #764ba2);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
background-clip: text;
|
|
letter-spacing: -0.5px;
|
|
}
|
|
.navbar-user {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 16px;
|
|
}
|
|
.user-info {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
color: #a0aec0;
|
|
font-size: 14px;
|
|
}
|
|
.avatar {
|
|
width: 36px;
|
|
height: 36px;
|
|
border-radius: 50%;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 16px;
|
|
font-weight: 700;
|
|
color: white;
|
|
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
|
|
}
|
|
|
|
/* 主内容区 */
|
|
.main-content {
|
|
display: flex;
|
|
max-width: 1400px;
|
|
margin: 0 auto;
|
|
min-height: calc(100vh - 64px);
|
|
}
|
|
|
|
/* 侧边栏 */
|
|
.sidebar {
|
|
width: 200px;
|
|
background: rgba(26, 26, 46, 0.8);
|
|
backdrop-filter: blur(20px);
|
|
padding: 16px 12px;
|
|
border-right: 1px solid rgba(102, 126, 234, 0.1);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
.sidebar-btn {
|
|
width: 100%;
|
|
text-align: left;
|
|
padding: 12px 16px;
|
|
border: none;
|
|
background: transparent;
|
|
border-radius: 12px;
|
|
cursor: pointer;
|
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
color: #a0aec0;
|
|
font-size: 14px;
|
|
font-weight: 500;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
.sidebar-btn:hover {
|
|
background: rgba(102, 126, 234, 0.1);
|
|
color: #667eea;
|
|
transform: translateX(4px);
|
|
}
|
|
.sidebar-btn.active {
|
|
background: linear-gradient(90deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
|
|
color: #667eea;
|
|
font-weight: 600;
|
|
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
|
|
}
|
|
.sidebar-btn.active::after {
|
|
content: '';
|
|
position: absolute;
|
|
left: 0;
|
|
top: 0;
|
|
bottom: 0;
|
|
width: 3px;
|
|
background: linear-gradient(180deg, #667eea, #764ba2);
|
|
border-radius: 0 4px 4px 0;
|
|
}
|
|
|
|
/* 内容区域 */
|
|
.content-area {
|
|
flex: 1;
|
|
padding: 32px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
/* 页面切换 */
|
|
.page { display: none; animation: fadeIn 0.5s ease-out; }
|
|
.page.active { display: block; }
|
|
@keyframes fadeIn {
|
|
from { opacity: 0; transform: translateY(20px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
|
|
/* 统计卡片网格 */
|
|
.stats-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
gap: 20px;
|
|
margin-bottom: 40px;
|
|
}
|
|
.stat-card {
|
|
background: rgba(255, 255, 255, 0.05);
|
|
backdrop-filter: blur(10px);
|
|
border: 1px solid rgba(102, 126, 234, 0.1);
|
|
border-radius: 16px;
|
|
padding: 24px;
|
|
cursor: pointer;
|
|
transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
.stat-card::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: -100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
|
|
transition: left 0.6s;
|
|
}
|
|
.stat-card:hover::before {
|
|
left: 100%;
|
|
}
|
|
.stat-card:hover {
|
|
transform: translateY(-8px) scale(1.02);
|
|
border-color: rgba(102, 126, 234, 0.4);
|
|
box-shadow: 0 12px 32px rgba(102, 126, 234, 0.2);
|
|
}
|
|
.stat-title {
|
|
font-size: 13px;
|
|
color: #a0aec0;
|
|
margin-bottom: 12px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
font-weight: 500;
|
|
}
|
|
.stat-value {
|
|
font-size: 36px;
|
|
font-weight: 800;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
background-clip: text;
|
|
line-height: 1.2;
|
|
}
|
|
.stat-card.primary .stat-value { background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
|
|
.stat-card.success .stat-value { background: linear-gradient(135deg, #67c23a, #85e61d); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
|
|
.stat-card.warning .stat-value { background: linear-gradient(135deg, #e6a23c, #f5c543); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
|
|
.stat-card.danger .stat-value { background: linear-gradient(135deg, #f56c6c, #f79296); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
|
|
.stat-card.info .stat-value { background: linear-gradient(135deg, #409eff, #5cd0f3); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
|
|
|
|
/* 模块卡片 */
|
|
.module-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
gap: 20px;
|
|
}
|
|
.module-card {
|
|
background: rgba(255, 255, 255, 0.05);
|
|
backdrop-filter: blur(10px);
|
|
border: 1px solid rgba(102, 126, 234, 0.1);
|
|
border-radius: 16px;
|
|
padding: 24px;
|
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
position: relative;
|
|
}
|
|
.module-card:hover {
|
|
transform: translateY(-6px);
|
|
border-color: rgba(102, 126, 234, 0.3);
|
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
|
|
}
|
|
.module-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 16px;
|
|
}
|
|
.module-title {
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
color: #e0e6ed;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
.module-status {
|
|
padding: 6px 12px;
|
|
border-radius: 20px;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
background: rgba(103, 194, 58, 0.2);
|
|
color: #67c23a;
|
|
border: 1px solid rgba(103, 194, 58, 0.3);
|
|
}
|
|
.module-status.running {
|
|
animation: pulse 2s infinite;
|
|
}
|
|
@keyframes pulse {
|
|
0%, 100% { box-shadow: 0 0 0 0 rgba(103, 194, 58, 0.4); }
|
|
50% { box-shadow: 0 0 0 8px rgba(103, 194, 58, 0); }
|
|
}
|
|
.module-content {
|
|
font-size: 14px;
|
|
color: #a0aec0;
|
|
line-height: 1.8;
|
|
}
|
|
.module-content div {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 4px 0;
|
|
border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
|
|
}
|
|
.module-content div:last-child { border-bottom: none; }
|
|
|
|
/* 移动端导航 */
|
|
.mobile-nav {
|
|
display: none;
|
|
position: fixed;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
background: rgba(26, 26, 46, 0.95);
|
|
backdrop-filter: blur(20px);
|
|
border-top: 1px solid rgba(102, 126, 234, 0.2);
|
|
padding: 8px 0;
|
|
z-index: 1000;
|
|
box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
|
|
}
|
|
.mobile-nav-btn {
|
|
flex: 1;
|
|
border: none;
|
|
background: transparent;
|
|
padding: 12px 8px;
|
|
text-align: center;
|
|
font-size: 12px;
|
|
color: #a0aec0;
|
|
cursor: pointer;
|
|
transition: all 0.3s;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
.mobile-nav-btn.active {
|
|
color: #667eea;
|
|
font-weight: 600;
|
|
}
|
|
.mobile-nav-btn.active::before {
|
|
content: '';
|
|
width: 4px;
|
|
height: 4px;
|
|
border-radius: 50%;
|
|
background: linear-gradient(135deg, #667eea, #764ba2);
|
|
margin-bottom: 2px;
|
|
}
|
|
|
|
/* 响应式 */
|
|
@media (max-width: 768px) {
|
|
.sidebar { display: none; }
|
|
.mobile-nav { display: flex; }
|
|
.content-area {
|
|
padding: 16px;
|
|
padding-bottom: 80px;
|
|
}
|
|
.stats-grid {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
gap: 12px;
|
|
}
|
|
.stat-card { padding: 16px; }
|
|
.stat-value { font-size: 24px; }
|
|
.module-grid { grid-template-columns: 1fr; }
|
|
}
|
|
</style>
|
|
<style>
|
|
body { background: #f5f7fa !important; color: #303133 !important; }
|
|
.navbar { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important; border-bottom: none !important; backdrop-filter: none !important; }
|
|
.navbar-title { background: none !important; -webkit-text-fill-color: white !important; color: white !important; }
|
|
.user-info { color: white !important; }
|
|
.avatar { background: rgba(255,255,255,0.2) !important; color: white !important; }
|
|
.sidebar { background: white !important; border-right: 1px solid #ebeef5 !important; backdrop-filter: none !important; }
|
|
.sidebar-btn { color: #606266 !important; }
|
|
.sidebar-btn:hover, .sidebar-btn.active { background: #ecf5ff !important; color: #409eff !important; }
|
|
.mobile-nav { background: white !important; border-top: 1px solid #ebeef5 !important; backdrop-filter: none !important; box-shadow: 0 -2px 8px rgba(0,0,0,0.1) !important; }
|
|
.mobile-nav-btn { color: #606266 !important; }
|
|
.mobile-nav-btn.active { color: #409eff !important; }
|
|
.mobile-nav-btn.active::before { content: none !important; display: none !important; }
|
|
#page-overview h2, #page-overview h3, #page-overview .module-title { color: #303133 !important; }
|
|
#page-overview .module-content { color: #303133 !important; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="app">
|
|
<nav class="navbar" v-if="isLoggedIn">
|
|
<div class="navbar-content">
|
|
<h1 class="navbar-title">宇之然内容创作平台</h1>
|
|
<div class="navbar-user">
|
|
<div class="user-info">
|
|
<div class="avatar">{{ currentUser.username ? currentUser.username.charAt(0).toUpperCase() : '?' }}</div>
|
|
<span>{{ currentUser.username }}</span>
|
|
<el-tag v-if="isAdmin" size="small" type="danger" style="border: none;">管理员</el-tag>
|
|
</div>
|
|
<el-button size="small" type="danger" plain @click="handleLogout">退出</el-button>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="main-content" v-if="isLoggedIn">
|
|
<aside class="sidebar">
|
|
<button class="sidebar-btn" :class="{ active: currentPage === 'overview' }" @click="redirectToPage('/')">
|
|
📊 系统概览
|
|
</button>
|
|
<button class="sidebar-btn" :class="{ active: currentPage === 'topics' }" @click="redirectToPage('topics.html')">
|
|
📋 选题管理
|
|
</button>
|
|
<button class="sidebar-btn" :class="{ active: currentPage === 'logs' }" @click="redirectToPage('logs.html')">
|
|
📄 系统日志
|
|
</button>
|
|
<button v-if="isAdmin" class="sidebar-btn" :class="{ active: currentPage === 'users' }" @click="redirectToPage('users.html')">
|
|
👥 用户管理
|
|
</button>
|
|
</aside>
|
|
|
|
<main class="content-area">
|
|
<!-- 系统概览页面 -->
|
|
<div id="page-overview" class="page" :class="{ active: currentPage === 'overview' }">
|
|
<h2 style="font-size: 28px; font-weight: 700; margin-bottom: 32px; color: #e0e6ed;">
|
|
📊 系统概览
|
|
</h2>
|
|
|
|
<!-- 统计卡片 -->
|
|
<div class="stats-grid">
|
|
<div class="stat-card primary" @click="goToTopics('')">
|
|
<div class="stat-title">选题总数</div>
|
|
<div class="stat-value">{{ stats.total }}</div>
|
|
</div>
|
|
<div class="stat-card warning" @click="goToTopics('pending')">
|
|
<div class="stat-title">待处理</div>
|
|
<div class="stat-value">{{ stats.pending }}</div>
|
|
</div>
|
|
<div class="stat-card danger" @click="goToTopics('review')">
|
|
<div class="stat-title">待审查</div>
|
|
<div class="stat-value">{{ stats.review }}</div>
|
|
</div>
|
|
<div class="stat-card success" @click="goToTopics('ready')">
|
|
<div class="stat-title">待发布</div>
|
|
<div class="stat-value">{{ stats.ready }}</div>
|
|
</div>
|
|
<div class="stat-card info" @click="goToTopics('published')">
|
|
<div class="stat-title">已发布</div>
|
|
<div class="stat-value">{{ stats.published }}</div>
|
|
</div>
|
|
<div class="stat-card primary" @click="goToTopics('')">
|
|
<div class="stat-title">今日新增</div>
|
|
<div class="stat-value">{{ stats.today }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 模块状态 -->
|
|
<h3 style="font-size: 20px; font-weight: 600; margin-bottom: 24px; color: #e0e6ed;">
|
|
🔧 模块状态
|
|
</h3>
|
|
<div class="module-grid">
|
|
<div class="module-card">
|
|
<div class="module-header">
|
|
<span class="module-title">🤖 内容创作引擎</span>
|
|
<span class="module-status running">运行中</span>
|
|
</div>
|
|
<div class="module-content">
|
|
<div><span>最后运行</span><span>2026-04-27 14:30</span></div>
|
|
<div><span>今日任务</span><span>12 个</span></div>
|
|
<div><span>成功率</span><span>95%</span></div>
|
|
</div>
|
|
</div>
|
|
<div class="module-card">
|
|
<div class="module-header">
|
|
<span class="module-title">🔍 内容优化器</span>
|
|
<span class="module-status running">运行中</span>
|
|
</div>
|
|
<div class="module-content">
|
|
<div><span>最后运行</span><span>2026-04-27 14:45</span></div>
|
|
<div><span>今日优化</span><span>8 个</span></div>
|
|
<div><span>平均提升</span><span>+12 分</span></div>
|
|
</div>
|
|
</div>
|
|
<div class="module-card">
|
|
<div class="module-header">
|
|
<span class="module-title">📡 内容收集器</span>
|
|
<span class="module-status running">运行中</span>
|
|
</div>
|
|
<div class="module-content">
|
|
<div><span>最后运行</span><span>2026-04-27 14:00</span></div>
|
|
<div><span>今日收集</span><span>24 个</span></div>
|
|
<div><span>来源平台</span><span>8 个</span></div>
|
|
</div>
|
|
</div>
|
|
<div class="module-card">
|
|
<div class="module-header">
|
|
<span class="module-title">📤 发布管理器</span>
|
|
<span class="module-status running">运行中</span>
|
|
</div>
|
|
<div class="module-content">
|
|
<div><span>最后运行</span><span>2026-04-27 13:30</span></div>
|
|
<div><span>今日发布</span><span>5 个</span></div>
|
|
<div><span>成功率</span><span>100%</span></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<!-- 移动端导航 -->
|
|
<nav class="mobile-nav" v-if="isLoggedIn">
|
|
<button class="mobile-nav-btn" :class="{ active: currentPage === 'overview' }" @click="redirectToPage('/')">
|
|
📊 概览
|
|
</button>
|
|
<button class="mobile-nav-btn" :class="{ active: currentPage === 'topics' }" @click="redirectToPage('topics.html')">
|
|
📋 选题
|
|
</button>
|
|
<button class="mobile-nav-btn" :class="{ active: currentPage === 'logs' }" @click="redirectToPage('logs.html')">
|
|
📄 日志
|
|
</button>
|
|
<button v-if="isAdmin" class="mobile-nav-btn" :class="{ active: currentPage === 'users' }" @click="redirectToPage('users.html')">
|
|
👥 用户
|
|
</button>
|
|
</nav>
|
|
</div>
|
|
|
|
<script src="vue.global.prod.js"></script>
|
|
<script src="element-plus.full.js"></script>
|
|
<script>
|
|
const App = {
|
|
data() {
|
|
return {
|
|
isLoggedIn: false,
|
|
isAdmin: false,
|
|
currentUser: { username: '' },
|
|
currentPage: 'overview',
|
|
stats: {
|
|
total: 0,
|
|
pending: 0,
|
|
review: 0,
|
|
ready: 0,
|
|
published: 0,
|
|
today: 0
|
|
}
|
|
};
|
|
},
|
|
methods: {
|
|
async handleLogin() {
|
|
this.loginLoading = true;
|
|
this.loginError = '';
|
|
try {
|
|
const response = await fetch('/api/auth/login', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify(this.loginForm)
|
|
});
|
|
if (!response.ok) throw new Error('登录失败');
|
|
const data = await response.json();
|
|
localStorage.setItem('authToken', data.token);
|
|
this.currentUser = data.user;
|
|
this.isAdmin = data.user.role === 'admin';
|
|
this.isLoggedIn = true;
|
|
this.currentPage = 'overview';
|
|
this.fetchStats();
|
|
} catch (error) {
|
|
this.loginError = '用户名或密码错误';
|
|
} finally {
|
|
this.loginLoading = false;
|
|
}
|
|
},
|
|
handleLogout() {
|
|
localStorage.removeItem('authToken');
|
|
this.isLoggedIn = false;
|
|
this.currentUser = { username: '' };
|
|
this.isAdmin = false;
|
|
},
|
|
async fetchStats() {
|
|
try {
|
|
const token = localStorage.getItem('authToken');
|
|
if (!token) {
|
|
window.location.href = '/login.html';
|
|
return;
|
|
}
|
|
const response = await fetch('/api/system/status', {
|
|
headers: { 'Authorization': 'Bearer ' + token }
|
|
});
|
|
if (response.ok) {
|
|
const data = await response.json();
|
|
// API返回格式: { stats: { total, pending, review, ready, published, today } }
|
|
this.stats = {
|
|
total: data.stats?.total || 0,
|
|
pending: data.stats?.pending || 0,
|
|
review: data.stats?.review || 0,
|
|
ready: data.stats?.ready || 0,
|
|
published: data.stats?.published || 0,
|
|
today: data.stats?.today || 0
|
|
};
|
|
} else if (response.status === 401) {
|
|
// Token无效,清除并跳转登录
|
|
localStorage.removeItem('authToken');
|
|
window.location.href = '/login.html';
|
|
} else {
|
|
console.error('获取统计信息失败:', response.status, response.statusText);
|
|
this.stats = { total: 0, pending: 0, review: 0, ready: 0, published: 0, today: 0 };
|
|
}
|
|
} catch (error) {
|
|
console.error('获取统计信息失败:', error);
|
|
// 失败时设置为0,避免页面空白
|
|
this.stats = { total: 0, pending: 0, review: 0, ready: 0, published: 0, today: 0 };
|
|
}
|
|
},
|
|
goToTopics(filter) {
|
|
const url = filter ? '/topics.html?filter=' + encodeURIComponent(filter) : '/topics.html';
|
|
window.location.href = url;
|
|
},
|
|
redirectToPage(page) {
|
|
window.location.href = page.startsWith('/') ? page : '/' + page;
|
|
}
|
|
},
|
|
mounted() {
|
|
const token = localStorage.getItem('authToken');
|
|
if (!token) {
|
|
window.location.href = '/login.html';
|
|
return;
|
|
}
|
|
fetch('/api/auth/me', {
|
|
headers: { 'Authorization': 'Bearer ' + token }
|
|
})
|
|
.then(response => response.ok ? response.json() : Promise.reject())
|
|
.then(data => {
|
|
this.currentUser = data.user;
|
|
this.isAdmin = data.user.role === 'admin';
|
|
this.isLoggedIn = true;
|
|
this.currentPage = 'overview';
|
|
this.fetchStats();
|
|
})
|
|
.catch(() => {
|
|
localStorage.removeItem('authToken');
|
|
window.location.href = '/login.html';
|
|
});
|
|
}
|
|
};
|
|
|
|
const app = Vue.createApp(App);
|
|
app.use(ElementPlus);
|
|
app.mount('#app');
|
|
</script>
|
|
</body>
|
|
</html>
|