整合資料庫、完成登入註冊忘記密碼功能
This commit is contained in:
27
scripts/test-api-debug.js
Normal file
27
scripts/test-api-debug.js
Normal file
@@ -0,0 +1,27 @@
|
||||
async function testApiDebug() {
|
||||
console.log('🧪 調試 API 錯誤...\n');
|
||||
|
||||
try {
|
||||
// 測試用戶列表 API
|
||||
console.log('1. 測試用戶列表 API...');
|
||||
const response = await fetch('http://localhost:3000/api/admin/users');
|
||||
|
||||
console.log('狀態碼:', response.status);
|
||||
console.log('狀態文本:', response.statusText);
|
||||
|
||||
const data = await response.text();
|
||||
console.log('響應內容:', data);
|
||||
|
||||
if (response.ok) {
|
||||
const jsonData = JSON.parse(data);
|
||||
console.log('✅ API 成功:', jsonData);
|
||||
} else {
|
||||
console.log('❌ API 失敗');
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ 測試過程中發生錯誤:', error);
|
||||
}
|
||||
}
|
||||
|
||||
testApiDebug();
|
Reference in New Issue
Block a user