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>
29 lines
818 B
JavaScript
29 lines
818 B
JavaScript
const axios = require('axios');
|
|
const qs = require('qs');
|
|
|
|
async function testEndpoint() {
|
|
try {
|
|
const data = {
|
|
taskId: 1,
|
|
targets: [{
|
|
targetType: 1,
|
|
targetValue: 'kt66778899',
|
|
displayName: '测试用户'
|
|
}]
|
|
};
|
|
|
|
console.log('Data to send:', JSON.stringify(data, null, 2));
|
|
|
|
const response = await axios.post('http://localhost:3000/directMessageTarget/test-batchAdd', qs.stringify(data), {
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
}
|
|
});
|
|
|
|
console.log('Response:', response.data);
|
|
} catch (error) {
|
|
console.error('Error:', error.response?.data || error.message);
|
|
}
|
|
}
|
|
|
|
testEndpoint(); |