Update templates/index.html
Browse files- templates/index.html +5 -4
templates/index.html
CHANGED
@@ -4,6 +4,7 @@
|
|
4 |
<head>
|
5 |
<meta charset="UTF-8">
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
7 |
<title>教育AI助手开发平台</title>
|
8 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
|
9 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
|
@@ -1100,7 +1101,7 @@ function toggleKnowledgeSelection(element) {
|
|
1100 |
// 加载知识库列表
|
1101 |
async function loadKnowledgeBases() {
|
1102 |
try {
|
1103 |
-
const response = await fetch(
|
1104 |
const result = await response.json();
|
1105 |
|
1106 |
if (result.success) {
|
@@ -1244,7 +1245,7 @@ async function createKnowledgeBase(event) {
|
|
1244 |
formData.append('file', fileInput.files[0]);
|
1245 |
|
1246 |
try {
|
1247 |
-
const response = await fetch('
|
1248 |
method: 'POST',
|
1249 |
body: formData
|
1250 |
});
|
@@ -1284,7 +1285,7 @@ async function addFileToKnowledgeBase(form) {
|
|
1284 |
formData.append('file', fileInput.files[0]);
|
1285 |
|
1286 |
try {
|
1287 |
-
const response = await fetch(
|
1288 |
method: 'POST',
|
1289 |
body: formData
|
1290 |
});
|
@@ -1315,7 +1316,7 @@ async function deleteKnowledgeBase(knowledgeId) {
|
|
1315 |
}
|
1316 |
|
1317 |
try {
|
1318 |
-
const response = await fetch(
|
1319 |
method: 'DELETE'
|
1320 |
});
|
1321 |
|
|
|
4 |
<head>
|
5 |
<meta charset="UTF-8">
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
+
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
|
8 |
<title>教育AI助手开发平台</title>
|
9 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
|
10 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
|
|
|
1101 |
// 加载知识库列表
|
1102 |
async function loadKnowledgeBases() {
|
1103 |
try {
|
1104 |
+
const response = await fetch('/api/knowledge');
|
1105 |
const result = await response.json();
|
1106 |
|
1107 |
if (result.success) {
|
|
|
1245 |
formData.append('file', fileInput.files[0]);
|
1246 |
|
1247 |
try {
|
1248 |
+
const response = await fetch('/api/knowledge', {
|
1249 |
method: 'POST',
|
1250 |
body: formData
|
1251 |
});
|
|
|
1285 |
formData.append('file', fileInput.files[0]);
|
1286 |
|
1287 |
try {
|
1288 |
+
const response = await fetch(`/api/knowledge/${knowledgeId}/documents`, {
|
1289 |
method: 'POST',
|
1290 |
body: formData
|
1291 |
});
|
|
|
1316 |
}
|
1317 |
|
1318 |
try {
|
1319 |
+
const response = await fetch(`/api/knowledge/${knowledgeId}`, {
|
1320 |
method: 'DELETE'
|
1321 |
});
|
1322 |
|