feat: 管理员页面整合与侧边栏导航优化

- 完成系统管理页面与导航整合
- 在 users.html/topics.html/logs.html 侧边栏与移动导航添加系统管理入口
- 创建 admin.html 管理页面(案例/任务日志/LLM配置/系统配置)
- 新增核心模块:collector.py(数据采集器)、scheduler.py(任务调度器)
- 新增脚本:collector_db_integration.py(采集器数据库整合)
- 更新项目文档并验证路由注册
This commit is contained in:
lt
2026-05-08 09:26:06 +08:00
parent 31d6306e3b
commit df5a9db3ad
8 changed files with 341 additions and 34 deletions
+9 -2
View File
@@ -255,6 +255,7 @@ const app = createApp({
const activeTab = ref('cases');
const currentUser = ref({ username: '' });
const redirectToPage = (page) => { window.location.href = '/' + page; }; const currentUser = ref({ username: '' });
const isAdmin = ref(false);
const isLoggedIn = ref(false);
@@ -262,8 +263,9 @@ const app = createApp({
fetch('/api/auth/me', { headers: { 'Authorization': 'Bearer ' + token } })
.then(response => response.ok ? response.json() : Promise.reject())
.then(data => {
currentUser.value = data.user;
isAdmin.value = data.user.role === 'admin';
const user = data.user || { username: '', role: 'user' };
currentUser.value = user;
isAdmin.value = user.role === 'admin';
isLoggedIn.value = true;
if (!isAdmin.value) {
ElMessage.warning('需要管理员权限');
@@ -275,6 +277,11 @@ const app = createApp({
window.location.href = 'login.html';
});
// 页面跳转
const redirectToPage = (page) => {
window.location.href = '/' + page;
};
// Cases
const cases = ref([]);
const caseDialogVisible = ref(false);