Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

fix(ui): Fix CSP error

wizardchend28f805707ed
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index d16df4bee..87b6c68bf 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "knowledage-base",
- "version": "0.1.0",
+ "version": "0.1.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "knowledage-base",
- "version": "0.1.0",
+ "version": "0.1.3",
"dependencies": {
"@microsoft/fetch-event-source": "^2.0.1",
"@types/dompurify": "^3.0.5",
@@ -15,6 +15,7 @@
"marked": "^5.1.2",
"pagefind": "^1.1.1",
"pinia": "^3.0.1",
+ "tdesign-icons-vue-next": "^0.4.1",
"tdesign-vue-next": "^1.11.5",
"vue": "^3.5.13",
"vue-router": "^4.5.0",
@@ -3400,9 +3401,10 @@
}
},
"node_modules/tdesign-icons-vue-next": {
- "version": "0.3.6",
- "resolved": "https://mirrors.tencent.com/npm/tdesign-icons-vue-next/-/tdesign-icons-vue-next-0.3.6.tgz",
- "integrity": "sha512-X9u90dBv8tPhfpguUyx+BzF8CU2ef2L4RXOO7MYOj1ufHCHwBXTF8L3GPfq6KZd/2u4vMLYAA8lGURn4PZZICw==",
+ "version": "0.4.1",
+ "resolved": "https://mirrors.tencent.com/npm/tdesign-icons-vue-next/-/tdesign-icons-vue-next-0.4.1.tgz",
+ "integrity": "sha512-uDPuTLRORnGcTyVGNoentNaK4V+ZcBmhYwcY3KqDaQQ5rrPeLMxu0ZVmgOEf0JtF2QZiqAxY7vodNEiLUdoRKA==",
+ "license": "MIT",
"dependencies": {
"@babel/runtime": "^7.16.3"
},
@@ -3436,6 +3438,18 @@
"vue": ">=3.1.0"
}
},
+ "node_modules/tdesign-vue-next/node_modules/tdesign-icons-vue-next": {
+ "version": "0.3.7",
+ "resolved": "https://mirrors.tencent.com/npm/tdesign-icons-vue-next/-/tdesign-icons-vue-next-0.3.7.tgz",
+ "integrity": "sha512-Q5ebVty/TCqhBa0l/17kkhjC0pBAOGvn7C35MAt1xS+johKVM9QEDOy9R6XEl332AiwQ37MwqioczqjYC30ckw==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.16.3"
+ },
+ "peerDependencies": {
+ "vue": "^3.0.0"
+ }
+ },
"node_modules/terser": {
"version": "5.43.1",
"resolved": "https://mirrors.tencent.com/npm/terser/-/terser-5.43.1.tgz",
diff --git a/frontend/package.json b/frontend/package.json
index 121d93dd2..10149fbd0 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -19,6 +19,7 @@
"marked": "^5.1.2",
"pagefind": "^1.1.1",
"pinia": "^3.0.1",
+ "tdesign-icons-vue-next": "^0.4.1",
"tdesign-vue-next": "^1.11.5",
"vue": "^3.5.13",
"vue-router": "^4.5.0",
diff --git a/frontend/src/api/initialization/index.ts b/frontend/src/api/initialization/index.ts
index 6d1f35341..66591c797 100644
--- a/frontend/src/api/initialization/index.ts
+++ b/frontend/src/api/initialization/index.ts
@@ -316,9 +316,17 @@ export function testMultimodalFunction(testData: {
formData.append('chunk_overlap', testData.chunk_overlap.toString());
formData.append('separators', JSON.stringify(testData.separators));
+ // 获取鉴权Token
+ const token = localStorage.getItem('weknora_token');
+ const headers: Record<string, string> = {};
+ if (token) {
+ headers['Authorization'] = `Bearer ${token}`;
+ }
+
// 使用原生fetch因为需要发送FormData
fetch('/api/v1/initialization/multimodal/test', {
method: 'POST',
+ headers,
body: formData
})
.then(response => response.json())