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>
89 lines
3.5 KiB
HTML
89 lines
3.5 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Debug API</title>
|
|
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
|
<script src="https://unpkg.com/qs/dist/qs.js"></script>
|
|
</head>
|
|
<body>
|
|
<h1>Debug API Test</h1>
|
|
<button onclick="login()">Login</button>
|
|
<button onclick="testGroupTaskList()">Test Group Task List</button>
|
|
<button onclick="testProxyPlatformList()">Test Proxy Platform List</button>
|
|
<div id="result"></div>
|
|
|
|
<script>
|
|
let token = localStorage.getItem('token') || '';
|
|
|
|
async function login() {
|
|
try {
|
|
const response = await axios.post('http://localhost:8890/api/login', {
|
|
username: 'admin',
|
|
password: '111111'
|
|
}, {
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
},
|
|
transformRequest: [function (data) {
|
|
return Qs.stringify(data);
|
|
}]
|
|
});
|
|
|
|
if (response.data.success) {
|
|
token = response.data.token;
|
|
localStorage.setItem('token', token);
|
|
document.getElementById('result').innerHTML = 'Login successful! Token: ' + token;
|
|
} else {
|
|
document.getElementById('result').innerHTML = 'Login failed: ' + JSON.stringify(response.data);
|
|
}
|
|
} catch (error) {
|
|
document.getElementById('result').innerHTML = 'Login error: ' + error.message;
|
|
}
|
|
}
|
|
|
|
async function testGroupTaskList() {
|
|
try {
|
|
const response = await axios.post('http://localhost:8890/groupTask/list', {}, {
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
'token': token
|
|
},
|
|
transformRequest: [function (data) {
|
|
return Qs.stringify(data);
|
|
}]
|
|
});
|
|
|
|
document.getElementById('result').innerHTML = '<pre>' + JSON.stringify(response.data, null, 2) + '</pre>';
|
|
} catch (error) {
|
|
document.getElementById('result').innerHTML = 'Error: ' + error.message + '<br>' +
|
|
(error.response ? JSON.stringify(error.response.data) : '');
|
|
}
|
|
}
|
|
|
|
async function testProxyPlatformList() {
|
|
try {
|
|
const response = await axios.post('http://localhost:8890/proxyPlatform/list', {}, {
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
'token': token
|
|
},
|
|
transformRequest: [function (data) {
|
|
return Qs.stringify(data);
|
|
}]
|
|
});
|
|
|
|
document.getElementById('result').innerHTML = '<pre>' + JSON.stringify(response.data, null, 2) + '</pre>';
|
|
} catch (error) {
|
|
document.getElementById('result').innerHTML = 'Error: ' + error.message + '<br>' +
|
|
(error.response ? JSON.stringify(error.response.data) : '');
|
|
}
|
|
}
|
|
|
|
// Show current token
|
|
if (token) {
|
|
document.getElementById('result').innerHTML = 'Using existing token: ' + token;
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |