diff --git a/admin/customer_service.php b/admin/customer_service.php index bc5dbab..97451b9 100644 --- a/admin/customer_service.php +++ b/admin/customer_service.php @@ -321,7 +321,7 @@ let notifySound = new Audio('https://assets.mixkit.co/active_storage/sfx/2358/23 const searchInput = document.getElementById('user-search'); const search = searchInput ? searchInput.value.toLowerCase() : ''; - const r = await fetch('/api/chat.php?action=admin_get_all'); + const r = await fetch('../api/chat.php?action=admin_get_all'); if (!r.ok) return; const users = await r.json(); @@ -455,14 +455,14 @@ let notifySound = new Audio('https://assets.mixkit.co/active_storage/sfx/2358/23 fd.append('user_id', userId); fd.append('ip_address', ip); fd.append('session_id', sid); - fetch('/api/chat.php?action=mark_read', { method: 'POST', body: fd }).then(() => refreshUsers()); + fetch('../api/chat.php?action=mark_read', { method: 'POST', body: fd }).then(() => refreshUsers()); } async function recallMessage(msgId) { if (!confirm('确定撤回该消息吗?')) return; const fd = new URLSearchParams(); fd.append('message_id', msgId); - const r = await fetch('/api/chat.php?action=admin_recall_message', { method: 'POST', body: fd }); + const r = await fetch('../api/chat.php?action=admin_recall_message', { method: 'POST', body: fd }); const res = await r.json(); if (res.success) { fetchMessages(); @@ -476,7 +476,7 @@ async function deleteChat(userId, ip, sid, event) { fd.append('user_id', userId); fd.append('ip_address', ip); fd.append('session_id', sid); - const r = await fetch('/api/chat.php?action=admin_delete_user', { method: 'POST', body: fd }); + const r = await fetch('../api/chat.php?action=admin_delete_user', { method: 'POST', body: fd }); const res = await r.json(); if (res.success) { if (selectedSid == sid && selectedIp == ip && selectedUser == userId) { @@ -503,7 +503,7 @@ async function deleteUser() { fd.append('user_id', selectedUser); fd.append('ip_address', selectedIp); fd.append('session_id', selectedSid); - const r = await fetch('/api/chat.php?action=admin_delete_user', { method: 'POST', body: fd }); + const r = await fetch('../api/chat.php?action=admin_delete_user', { method: 'POST', body: fd }); const res = await r.json(); if (res.success) { selectedUser = null; @@ -525,7 +525,7 @@ async function deleteUser() { async function fetchMessages() { if (!selectedIp && !selectedUser && !selectedSid) return; try { - const r = await fetch(`/api/chat.php?action=get_messages&user_id=${selectedUser}&ip=${selectedIp}&session_id=${selectedSid}`); + const r = await fetch(`../api/chat.php?action=get_messages&user_id=${selectedUser}&ip=${selectedIp}&session_id=${selectedSid}`); const msgs = await r.json(); if (!msgs || !Array.isArray(msgs)) return; @@ -637,7 +637,7 @@ async function notifyMatchSuccess() { fd.append('account', account); try { - const r = await fetch('/api/admin_recharge.php?action=match_success', { method: 'POST', body: fd }); + const r = await fetch('../api/admin_recharge.php?action=match_success', { method: 'POST', body: fd }); const res = await r.json(); if (res.success) { alert('匹配成功!状态已更新。若要向用户显示收款账户,请继续点击“发送账户”按钮。'); @@ -666,7 +666,7 @@ async function sendPaymentInfo() { try { console.log('Sending account info...', { bank, name, account }); - const r = await fetch('/api/admin_recharge.php?action=send_account', { method: 'POST', body: fd }); + const r = await fetch('../api/admin_recharge.php?action=send_account', { method: 'POST', body: fd }); const res = await r.json(); if (res.success) { @@ -712,7 +712,7 @@ document.getElementById('image-input').addEventListener('change', async (e) => { formData.append('session_id', selectedSid || ''); try { - const r = await fetch('/api/chat.php?action=upload_image', { + const r = await fetch('../api/chat.php?action=upload_image', { method: 'POST', body: formData }); @@ -762,7 +762,7 @@ document.getElementById('chat-form').addEventListener('submit', async (e) => { fd.append('session_id', selectedSid); try { - const r = await fetch('/api/chat.php?action=admin_send', { method: 'POST', body: fd }); + const r = await fetch('../api/chat.php?action=admin_send', { method: 'POST', body: fd }); const res = await r.json(); const tempMsg = document.querySelector(`[data-id="${tempId}"]`); @@ -784,7 +784,7 @@ document.getElementById('save-remark-btn').addEventListener('click', async () => fd.append('session_id', selectedSid); fd.append('remark', remark); - const r = await fetch('/api/chat.php?action=save_remark', { method: 'POST', body: fd }); + const r = await fetch('../api/chat.php?action=save_remark', { method: 'POST', body: fd }); const res = await r.json(); if (res.success) { alert('备注已保存'); diff --git a/admin/finance.php b/admin/finance.php index 450c11e..602fb84 100644 --- a/admin/finance.php +++ b/admin/finance.php @@ -215,20 +215,22 @@ $requests = $stmt->fetchAll();