Initial commit: Telegram Management System
Some checks failed
Deploy / deploy (push) Has been cancelled
Some checks failed
Deploy / deploy (push) Has been cancelled
Full-stack web application for Telegram management - Frontend: Vue 3 + Vben Admin - Backend: NestJS - Features: User management, group broadcast, statistics 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
94
open-and-check-errors.js
Normal file
94
open-and-check-errors.js
Normal file
@@ -0,0 +1,94 @@
|
||||
const { chromium } = require('playwright');
|
||||
|
||||
(async () => {
|
||||
let browser;
|
||||
|
||||
try {
|
||||
console.log('打开浏览器查看错误...');
|
||||
browser = await chromium.launch({
|
||||
headless: false,
|
||||
slowMo: 100
|
||||
});
|
||||
|
||||
const context = await browser.newContext({
|
||||
viewport: { width: 1920, height: 1080 }
|
||||
});
|
||||
|
||||
const page = await context.newPage();
|
||||
|
||||
// 开启控制台
|
||||
const cdpSession = await context.newCDPSession(page);
|
||||
await cdpSession.send('Runtime.enable');
|
||||
|
||||
// 监听所有控制台输出
|
||||
cdpSession.on('Runtime.consoleAPICalled', (event) => {
|
||||
const type = event.type;
|
||||
const args = event.args || [];
|
||||
|
||||
if (type === 'error' || type === 'warning') {
|
||||
console.log(`\n[${type.toUpperCase()}]`);
|
||||
args.forEach(arg => {
|
||||
if (arg.value) {
|
||||
console.log(arg.value);
|
||||
} else if (arg.description) {
|
||||
console.log(arg.description);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 监听运行时异常
|
||||
cdpSession.on('Runtime.exceptionThrown', (event) => {
|
||||
console.log('\n[EXCEPTION]');
|
||||
console.log(event.exceptionDetails.text);
|
||||
if (event.exceptionDetails.exception?.description) {
|
||||
console.log(event.exceptionDetails.exception.description);
|
||||
}
|
||||
});
|
||||
|
||||
console.log('\n访问 http://localhost:5173 ...');
|
||||
await page.goto('http://localhost:5173/', { waitUntil: 'domcontentloaded' });
|
||||
|
||||
// 等待页面加载
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
// 打开浏览器控制台
|
||||
console.log('\n打开开发者工具...');
|
||||
await page.keyboard.press('F12');
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// 登录
|
||||
console.log('\n执行登录...');
|
||||
await page.fill('[name="username"]', 'admin');
|
||||
await page.fill('[name="password"]', '111111');
|
||||
await page.click('button:has-text("登录")');
|
||||
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
// 检查当前状态
|
||||
console.log('\n当前状态:');
|
||||
console.log('URL:', page.url());
|
||||
console.log('标题:', await page.title());
|
||||
|
||||
// 检查菜单
|
||||
const menuCount = await page.locator('.ant-menu-item, .ant-menu-submenu').count();
|
||||
console.log('菜单项数量:', menuCount);
|
||||
|
||||
// 查看页面源代码中的错误
|
||||
const pageContent = await page.content();
|
||||
if (pageContent.includes('Failed to') || pageContent.includes('Error:')) {
|
||||
console.log('\n页面中可能包含错误信息');
|
||||
}
|
||||
|
||||
console.log('\n\n请查看浏览器控制台中的错误信息...');
|
||||
console.log('按Ctrl+C退出');
|
||||
|
||||
await new Promise(() => {});
|
||||
|
||||
} catch (error) {
|
||||
console.error('出错了:', error);
|
||||
if (browser) {
|
||||
await browser.close();
|
||||
}
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user