Twilioapp-admin/test-api.js
mars f20988b90c feat: 完成所有页面的演示模式实现
- 更新 DashboardLayout 组件,统一使用演示模式布局
- 实现仪表盘页面的完整演示数据和功能
- 完成用户管理页面的演示模式,包含搜索、过滤、分页等功能
- 实现通话记录页面的演示数据和录音播放功能
- 完成翻译员管理页面的演示模式
- 实现订单管理页面的完整功能
- 完成发票管理页面的演示数据
- 更新文档管理页面
- 添加 utils.ts 工具函数库
- 完善 API 路由和数据库结构
- 修复各种 TypeScript 类型错误
- 统一界面风格和用户体验
2025-06-30 19:42:43 +08:00

44 lines
934 B
JavaScript

const https = require('http');
const data = JSON.stringify({
email: 'admin@example.com',
password: 'admin123'
});
const options = {
hostname: 'localhost',
port: 3000,
path: '/api/auth/admin-login',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': data.length
}
};
const req = https.request(options, (res) => {
console.log(`状态码: ${res.statusCode}`);
console.log(`响应头: ${JSON.stringify(res.headers)}`);
let body = '';
res.on('data', (chunk) => {
body += chunk;
});
res.on('end', () => {
console.log('响应体:', body);
try {
const jsonResponse = JSON.parse(body);
console.log('解析后的响应:', JSON.stringify(jsonResponse, null, 2));
} catch (e) {
console.log('无法解析JSON响应');
}
});
});
req.on('error', (error) => {
console.error('请求错误:', error);
});
req.write(data);
req.end();