35 lines
893 B
JavaScript
35 lines
893 B
JavaScript
/**
|
|
* 测试提现接口
|
|
*/
|
|
|
|
async function testWithdrawalsAPI() {
|
|
try {
|
|
console.log('测试 /api/db/withdrawals 接口...\n')
|
|
|
|
const response = await fetch('http://localhost:3006/api/db/withdrawals', {
|
|
headers: {
|
|
'Cookie': 'admin_session=your-token-here'
|
|
}
|
|
})
|
|
|
|
console.log('状态码:', response.status)
|
|
console.log('状态文本:', response.statusText)
|
|
|
|
const data = await response.json()
|
|
console.log('\n响应数据:')
|
|
console.log(JSON.stringify(data, null, 2))
|
|
|
|
if (data.success) {
|
|
console.log('\n✅ 接口调用成功')
|
|
console.log('提现记录数:', data.withdrawals?.length || 0)
|
|
} else {
|
|
console.log('\n❌ 接口调用失败')
|
|
console.log('错误信息:', data.error)
|
|
}
|
|
} catch (error) {
|
|
console.error('\n❌ 请求失败:', error.message)
|
|
}
|
|
}
|
|
|
|
testWithdrawalsAPI()
|