From be3adf7b9da00cba1d041e5b6680c359bd939a14 Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Fri, 27 Jun 2025 01:48:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8E=9F=E6=9C=AC=20s?= =?UTF-8?q?tore=20=E4=B8=AD=E7=9A=84=20refreshDatabase=20=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/stores/database.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/src/stores/database.js b/web/src/stores/database.js index 6a5bf10a..36c9b7ea 100644 --- a/web/src/stores/database.js +++ b/web/src/stores/database.js @@ -1,5 +1,6 @@ import { ref, computed } from 'vue' import { defineStore } from 'pinia' +import { knowledgeBaseApi } from '@/apis/admin_api' export const useDatabaseStore = defineStore('database', () => { const db = ref({}) @@ -7,11 +8,10 @@ export const useDatabaseStore = defineStore('database', () => { db.value = newDatabase } - function refreshDatabase() { - fetch('/api/data').then(res => res.json()).then(data => { - console.log("database", data) - setDatabase(data.databases) - }) + async function refreshDatabase() { + const res = await knowledgeBaseApi.getDatabases() + console.log("database", res) + setDatabase(res.databases) } return { db, setDatabase, refreshDatabase }