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>
52 lines
1.8 KiB
JavaScript
52 lines
1.8 KiB
JavaScript
import axios from 'axios';
|
|
|
|
async function diagnose() {
|
|
console.log('=== Frontend Diagnosis ===\n');
|
|
|
|
// Test 1: Frontend server
|
|
try {
|
|
const response = await axios.get('http://localhost:3008/');
|
|
console.log('✅ Frontend server is running on port 3008');
|
|
} catch (error) {
|
|
console.log('❌ Frontend server not responding:', error.message);
|
|
}
|
|
|
|
// Test 2: API proxy
|
|
try {
|
|
const response = await axios.get('http://localhost:3008/api/v1/health');
|
|
console.log('✅ API proxy is working');
|
|
console.log(' Health status:', response.data.status);
|
|
} catch (error) {
|
|
console.log('❌ API proxy not working:', error.message);
|
|
}
|
|
|
|
// Test 3: Login endpoint
|
|
try {
|
|
const response = await axios.post('http://localhost:3008/api/v1/auth/login', {
|
|
username: 'admin',
|
|
password: 'admin123456'
|
|
});
|
|
console.log('✅ Login endpoint working');
|
|
console.log(' Token:', response.data.data.accessToken.substring(0, 50) + '...');
|
|
|
|
// Test 4: Protected endpoint
|
|
const token = response.data.data.accessToken;
|
|
try {
|
|
const dashResponse = await axios.get('http://localhost:3008/api/v1/analytics/dashboard', {
|
|
headers: {
|
|
'Authorization': `Bearer ${token}`
|
|
}
|
|
});
|
|
console.log('✅ Protected endpoints accessible');
|
|
console.log(' Dashboard data received');
|
|
} catch (error) {
|
|
console.log('❌ Protected endpoint error:', error.message);
|
|
}
|
|
} catch (error) {
|
|
console.log('❌ Login failed:', error.response?.data || error.message);
|
|
}
|
|
|
|
console.log('\n=== Diagnosis Complete ===');
|
|
}
|
|
|
|
diagnose(); |