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>
59 lines
2.2 KiB
HTML
59 lines
2.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Login Test</title>
|
|
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<h1>Login Test</h1>
|
|
<button onclick="testLogin()">Test Login</button>
|
|
<div id="result"></div>
|
|
|
|
<script>
|
|
async function testLogin() {
|
|
const resultDiv = document.getElementById('result');
|
|
resultDiv.innerHTML = 'Testing login...';
|
|
|
|
try {
|
|
const response = await axios.post('/api/v1/auth/login', {
|
|
username: 'admin',
|
|
password: 'admin123456'
|
|
});
|
|
|
|
console.log('Response:', response.data);
|
|
|
|
if (response.data.success) {
|
|
resultDiv.innerHTML = `
|
|
<h3>Login Success!</h3>
|
|
<p>Token: ${response.data.data.accessToken.substring(0, 50)}...</p>
|
|
<p>User: ${response.data.data.user.username} (${response.data.data.user.role})</p>
|
|
<button onclick="testDashboard('${response.data.data.accessToken}')">Test Dashboard API</button>
|
|
`;
|
|
} else {
|
|
resultDiv.innerHTML = `<h3>Login Failed: ${response.data.error}</h3>`;
|
|
}
|
|
} catch (error) {
|
|
resultDiv.innerHTML = `<h3>Error: ${error.message}</h3>`;
|
|
console.error('Login error:', error);
|
|
}
|
|
}
|
|
|
|
async function testDashboard(token) {
|
|
try {
|
|
const response = await axios.get('/api/v1/analytics/dashboard', {
|
|
headers: {
|
|
'Authorization': `Bearer ${token}`
|
|
}
|
|
});
|
|
console.log('Dashboard response:', response.data);
|
|
alert('Dashboard API works! Check console for data.');
|
|
} catch (error) {
|
|
console.error('Dashboard error:', error);
|
|
alert('Dashboard API error: ' + error.message);
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |