Files
telegram-management-system/monitor-vite-errors.sh
你的用户名 237c7802e5
Some checks failed
Deploy / deploy (push) Has been cancelled
Initial commit: Telegram Management System
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>
2025-11-04 15:37:50 +08:00

37 lines
909 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
echo "启动Vite开发服务器并监控错误..."
# 创建日志文件
LOG_FILE="vite-errors.log"
> $LOG_FILE
# 启动开发服务器并将输出重定向到日志文件
cd /Users/hahaha/telegram-management-system/frontend-vben
pnpm dev:antd 2>&1 | tee -a $LOG_FILE &
SERVER_PID=$!
echo "服务器已启动PID: $SERVER_PID"
echo "等待服务器启动..."
sleep 5
# 使用curl访问页面触发错误
echo "访问页面..."
curl -s http://localhost:5173/ > /dev/null
# 监控日志文件
echo "监控错误输出..."
tail -f $LOG_FILE | grep -E "ERROR|error|Error|failed|Failed" &
TAIL_PID=$!
# 等待一段时间
sleep 10
# 显示捕获的错误
echo -e "\n\n=== 捕获的错误 ==="
grep -E "ERROR|error|Error|failed|Failed|warning|Warning" $LOG_FILE || echo "没有发现明显的错误"
# 清理
kill $SERVER_PID $TAIL_PID 2>/dev/null
echo -e "\n完整日志保存在: $LOG_FILE"