更新提现和订单管理逻辑,新增用户佣金信息展示,优化提现审批流程以防止超额提现风险。同时,调整提现页面显示用户佣金详情,提升用户体验。重构API以支持新字段,确保数据一致性和准确性。
This commit is contained in:
34
scripts/test-withdrawals-api.js
Normal file
34
scripts/test-withdrawals-api.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* 测试提现接口
|
||||
*/
|
||||
|
||||
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()
|
||||
Reference in New Issue
Block a user