fix(ui): Fix CSP error

This commit is contained in:
wizardchen
2025-09-16 14:30:35 +08:00
committed by lyingbug
parent 722c5cebf2
commit e08ccb286c
3 changed files with 28 additions and 5 deletions
+8
View File
@@ -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())