fix: 修正后台管理模板API路径为 /api/admin/xxx

This commit is contained in:
2026-04-13 11:23:56 +08:00
parent 34afe96055
commit 9d35179210
7 changed files with 13 additions and 13 deletions

View File

@@ -142,8 +142,8 @@
// 加载数据
async function loadData() {
const [providersRes, profilesRes] = await Promise.all([
fetch('/api/providers'),
fetch('/api/auto-profiles')
fetch('/api/admin/providers'),
fetch('/api/admin/auto-profiles')
]);
providers = await providersRes.json();

View File

@@ -142,7 +142,7 @@
// 加载模型列表
async function loadModels() {
const res = await fetch('/api/chat/models');
const res = await fetch('/api/admin/chat/models');
models = await res.json();
}
@@ -156,7 +156,7 @@
// 加载对话列表
async function loadChats() {
const res = await fetch('/api/chat/list');
const res = await fetch('/api/admin/chat/list');
chats = await res.json();
renderChatList();
}
@@ -292,7 +292,7 @@
scrollToBottom();
try {
const res = await fetch('/api/chat/send', {
const res = await fetch('/api/admin/chat/send', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({

View File

@@ -57,7 +57,7 @@
<script>
async function loadConfig() {
const res = await fetch('/api/config');
const res = await fetch('/api/admin/config');
const data = await res.json();
const container = document.getElementById('configContent');

View File

@@ -178,7 +178,7 @@
<script>
async function loadStats() {
const res = await fetch('/api/stats');
const res = await fetch('/api/admin/stats');
const data = await res.json();
document.getElementById('stat-requests').textContent = data.total_requests;
@@ -194,7 +194,7 @@
}
async function loadProviders() {
const res = await fetch('/api/providers');
const res = await fetch('/api/admin/providers');
const providers = await res.json();
const container = document.getElementById('providerList');

View File

@@ -62,7 +62,7 @@
<script>
async function loadLogs() {
const res = await fetch('/api/logs');
const res = await fetch('/api/admin/logs');
const data = await res.json();
const container = document.getElementById('logContent');

View File

@@ -70,7 +70,7 @@
<script>
async function loadModels() {
const res = await fetch('/api/models');
const res = await fetch('/api/admin/models');
const models = await res.json();
const tbody = document.getElementById('modelTable');

View File

@@ -166,7 +166,7 @@
// 加载提供商列表
async function loadProviders() {
const res = await fetch('/api/providers');
const res = await fetch('/api/admin/providers');
providers = await res.json();
const container = document.getElementById('providerList');
@@ -304,7 +304,7 @@
const order = [...cards].map(card => card.dataset.id);
try {
const res = await fetch('/api/providers/priority', {
const res = await fetch('/api/admin/providers/priority', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ order })
@@ -394,7 +394,7 @@
});
} else {
// 新增
res = await fetch('/api/providers', {
res = await fetch('/api/admin/providers', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)