This commit is contained in:
Alex Yang
2025-11-25 00:35:37 +08:00
parent 9f81b449f1
commit c570f303e7
7 changed files with 56 additions and 50 deletions

View File

@@ -29,7 +29,7 @@ function loadHosts() {
showLoading(tbody);
// 更新API路径使用完整路径
apiRequest('/shield/hosts', 'GET')
apiRequest('/api/shield/hosts', 'GET')
.then(data => {
// 处理不同格式的响应数据
let hostsData;
@@ -156,7 +156,7 @@ function addHostsEntry() {
}
// 修复重复API调用问题只调用一次
apiRequest('/shield/hosts', 'POST', { ip: ip, domain: domain })
apiRequest('/api/shield/hosts', 'POST', { ip: ip, domain: domain })
.then(data => {
// 处理不同的响应格式
if (data.success || data.status === 'success') {
@@ -209,7 +209,7 @@ function deleteHostsEntry(ip, domain) {
}
// 更新API路径
apiRequest('/shield/hosts', 'DELETE', { ip: ip, domain: domain })
apiRequest('/api/shield/hosts', 'DELETE', { ip: ip, domain: domain })
.then(data => {
// 处理不同的响应格式
if (data.success || data.status === 'success') {