|
@@ -408,7 +408,6 @@
|
|
|
:visible.sync="promptDialog"
|
|
:visible.sync="promptDialog"
|
|
|
class="fileDialogBlock"
|
|
class="fileDialogBlock"
|
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
|
- :before-close="handleClose"
|
|
|
|
|
>
|
|
>
|
|
|
<span class="promptBox" v-loading="promptLoading">
|
|
<span class="promptBox" v-loading="promptLoading">
|
|
|
<!-- <el-input v-model="prompt" :placeholder="lang.promptPlaceholder" class="promptInput"></el-input> -->
|
|
<!-- <el-input v-model="prompt" :placeholder="lang.promptPlaceholder" class="promptInput"></el-input> -->
|
|
@@ -1022,22 +1021,25 @@ export default {
|
|
|
if (!dataFromForm) return;
|
|
if (!dataFromForm) return;
|
|
|
this.proVisible = true;
|
|
this.proVisible = true;
|
|
|
let uuid = uuidv4();
|
|
let uuid = uuidv4();
|
|
|
- let formData = new FormData();
|
|
|
|
|
let string = [this.folderid, this.moFolderid].filter((id) => id);
|
|
let string = [this.folderid, this.moFolderid].filter((id) => id);
|
|
|
- formData.append("url", dataFromForm.url)
|
|
|
|
|
- formData.append("collection_ids", JSON.stringify(string));
|
|
|
|
|
- formData.append("id", uuid);
|
|
|
|
|
- formData.append(
|
|
|
|
|
- "metadata",
|
|
|
|
|
- JSON.stringify({url: dataFromForm.url, collection_ids: string})
|
|
|
|
|
- );
|
|
|
|
|
- formData.append("ingestion_mode", "fast");
|
|
|
|
|
- formData.append("run_with_orchestration", "false");
|
|
|
|
|
- debugger
|
|
|
|
|
- const html2mdApi = process.env.VUE_APP_HTML2MD_API || 'http://localhost:7004';
|
|
|
|
|
- const url = html2mdApi + '/file/knowledge-base/html-to-markdown';
|
|
|
|
|
- const headers = {'Content-Type': 'multipart/form-data'};
|
|
|
|
|
- this.ajax.post(url, formData, {headers})
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 构建 JSON 请求体
|
|
|
|
|
+ const requestBody = {
|
|
|
|
|
+ url: dataFromForm.url,
|
|
|
|
|
+ collection_ids: string,
|
|
|
|
|
+ id: uuid,
|
|
|
|
|
+ metadata: {
|
|
|
|
|
+ url: dataFromForm.url,
|
|
|
|
|
+ collection_ids: string
|
|
|
|
|
+ },
|
|
|
|
|
+ ingestion_mode: "fast",
|
|
|
|
|
+ run_with_orchestration: false
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ console.log('环境变量 VUE_APP_HTML2MD_API:', process.env.APP_CENTER_API_BASE_URL);
|
|
|
|
|
+ const url = process.env.APP_CENTER_API_BASE_URL + '/api/webcrawler/knowledge-base/crawl-and-upload';
|
|
|
|
|
+ const headers = {'Content-Type': 'application/json'};
|
|
|
|
|
+ this.ajax.post(url, requestBody, {headers})
|
|
|
.then(async (response) => {
|
|
.then(async (response) => {
|
|
|
if (response && response.data && response.data.results) {
|
|
if (response && response.data && response.data.results) {
|
|
|
this.$message.success('文件上传成功');
|
|
this.$message.success('文件上传成功');
|
|
@@ -1410,9 +1412,9 @@ export default {
|
|
|
this.getData();
|
|
this.getData();
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
this.promptLoading = false
|
|
this.promptLoading = false
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
console.error(err);
|
|
console.error(err);
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|