主要更新: - 更新所有12个产业的教务系统数据和功能 - 删除所有 node_modules 文件夹(节省3.7GB) - 删除所有 .yoyo 缓存文件夹(节省1.2GB) - 删除所有 dist 构建文件(节省55MB) 项目优化: - 项目大小从 8.1GB 减少到 3.2GB(节省60%空间) - 保留完整的源代码和配置文件 - .gitignore 已配置,防止再次提交大文件 启动脚本: - start-industry.sh/bat/ps1 脚本会自动检测并安装依赖 - 首次启动时自动运行 npm install - 支持单个或批量启动产业系统 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
90 lines
3.6 KiB
JavaScript
90 lines
3.6 KiB
JavaScript
// 验证Agent板块设置
|
||
|
||
const fs = require('fs');
|
||
const path = require('path');
|
||
|
||
console.log('🔍 验证Agent板块设置\n');
|
||
console.log('='.repeat(80));
|
||
|
||
// 1. 检查AgentPage组件
|
||
console.log('\n1. 检查 AgentPage 组件');
|
||
const agentPagePath = path.join(__dirname, 'src/pages/AgentPage/index.jsx');
|
||
const agentCssPath = path.join(__dirname, 'src/pages/AgentPage/index.css');
|
||
|
||
const hasAgentPage = fs.existsSync(agentPagePath);
|
||
console.log(` ${hasAgentPage ? '✅' : '❌'} AgentPage组件文件存在`);
|
||
|
||
const hasAgentCss = fs.existsSync(agentCssPath);
|
||
console.log(` ${hasAgentCss ? '✅' : '❌'} AgentPage样式文件存在`);
|
||
|
||
if (hasAgentPage) {
|
||
const agentPageContent = fs.readFileSync(agentPagePath, 'utf-8');
|
||
const hasIframe = agentPageContent.includes('<iframe');
|
||
console.log(` ${hasIframe ? '✅' : '❌'} 包含iframe元素`);
|
||
|
||
const hasBaiduUrl = agentPageContent.includes('baidu.com');
|
||
console.log(` ${hasBaiduUrl ? '✅' : '❌'} 使用百度测试链接`);
|
||
}
|
||
|
||
// 2. 检查路由配置
|
||
console.log('\n2. 检查路由配置');
|
||
const routesPath = path.join(__dirname, 'src/routes/index.jsx');
|
||
const routesContent = fs.readFileSync(routesPath, 'utf-8');
|
||
|
||
const hasAgentImport = routesContent.includes('import("@/pages/AgentPage")');
|
||
console.log(` ${hasAgentImport ? '✅' : '❌'} 导入AgentPage组件`);
|
||
|
||
const hasAgentRoute = routesContent.includes('path: "/agent"');
|
||
console.log(` ${hasAgentRoute ? '✅' : '❌'} 定义/agent路由`);
|
||
|
||
const hasAgentName = routesContent.includes('name: "Agent"');
|
||
console.log(` ${hasAgentName ? '✅' : '❌'} 设置菜单名称为Agent`);
|
||
|
||
const hasDefaultIcon = routesContent.includes('default: "recuUY5tMX7M6A"');
|
||
console.log(` ${hasDefaultIcon ? '✅' : '❌'} 设置未点击图标`);
|
||
|
||
const hasActiveIcon = routesContent.includes('active: "recuUY5qlmzVhH"');
|
||
console.log(` ${hasActiveIcon ? '✅' : '❌'} 设置点击图标`);
|
||
|
||
const hasShowMenuItem = routesContent.match(/path: "\/agent"[\s\S]*?showMenuItem: true/);
|
||
console.log(` ${hasShowMenuItem ? '✅' : '❌'} 设置为显示菜单项`);
|
||
|
||
// 3. 检查Agent路由在资源板块中
|
||
console.log('\n3. 检查Agent在资源板块中的位置');
|
||
const resourceSection = routesContent.match(/name: "资源"[\s\S]*?(?=\{[\s\S]*?showMenu:)/);
|
||
if (resourceSection) {
|
||
const hasAgentInResource = resourceSection[0].includes('path: "/agent"');
|
||
console.log(` ${hasAgentInResource ? '✅' : '❌'} Agent路由在资源板块中`);
|
||
|
||
// 检查顺序
|
||
const portfolioIndex = resourceSection[0].indexOf('path: "/portfolio"');
|
||
const agentIndex = resourceSection[0].indexOf('path: "/agent"');
|
||
const isLastItem = portfolioIndex < agentIndex;
|
||
console.log(` ${isLastItem ? '✅' : '❌'} Agent在作品集之后(最下方)`);
|
||
}
|
||
|
||
console.log('\n' + '='.repeat(80));
|
||
|
||
const allChecksPassed =
|
||
hasAgentPage &&
|
||
hasAgentCss &&
|
||
hasAgentImport &&
|
||
hasAgentRoute &&
|
||
hasAgentName &&
|
||
hasDefaultIcon &&
|
||
hasActiveIcon &&
|
||
hasShowMenuItem;
|
||
|
||
if (allChecksPassed) {
|
||
console.log('\n✅ 所有检查通过!Agent板块已成功添加到侧边栏。\n');
|
||
console.log('📝 功能说明:');
|
||
console.log(' - ✅ 在侧边栏"资源"板块最下方添加了Agent菜单项');
|
||
console.log(' - ✅ 未点击图标: recuUY5tMX7M6A');
|
||
console.log(' - ✅ 点击图标: recuUY5qlmzVhH (白色)');
|
||
console.log(' - ✅ 页面内容: iframe嵌入百度测试页面');
|
||
console.log(' - ✅ 路由路径: /agent');
|
||
console.log('\n💡 下一步: 刷新页面后,在侧边栏资源板块最下方可以看到Agent菜单项');
|
||
} else {
|
||
console.log('\n⚠️ 部分检查未通过,请检查上述标记为❌的项目。\n');
|
||
}
|