diff --git a/server/routers/base_router.py b/server/routers/base_router.py index 2cf61851..48c0290a 100644 --- a/server/routers/base_router.py +++ b/server/routers/base_router.py @@ -12,6 +12,11 @@ base = APIRouter() async def route_index(): return {"message": "You Got It!"} +@base.get("/health") +async def health_check(): + """简单的健康检查接口""" + return {"status": "ok", "message": "服务正常运行"} + @base.get("/config") def get_config(current_user: User = Depends(get_admin_user)): return config.dump_config() diff --git a/web/src/apis/base.js b/web/src/apis/base.js index aad20564..54ef4b56 100644 --- a/web/src/apis/base.js +++ b/web/src/apis/base.js @@ -153,4 +153,22 @@ export function apiPut(url, data = {}, options = {}, requiresAuth = false) { */ export function apiDelete(url, options = {}, requiresAuth = false) { return apiRequest(url, { method: 'DELETE', ...options }, requiresAuth) +} + +/** + * 健康检查API + */ +export const healthApi = { + /** + * 检查服务端健康状态 + * @returns {Promise} - 健康检查结果 + */ + async checkHealth() { + try { + const response = await apiGet('/api/health') + return { status: 'ok', data: response } + } catch (error) { + return { status: 'error', error: error.message } + } + } } \ No newline at end of file diff --git a/web/src/views/DataBaseView.vue b/web/src/views/DataBaseView.vue index 3cf17920..8f1d91c3 100644 --- a/web/src/views/DataBaseView.vue +++ b/web/src/views/DataBaseView.vue @@ -2,7 +2,12 @@
@@ -27,7 +32,7 @@
-
+

新建知识库

@@ -56,23 +61,6 @@
-
@@ -90,6 +78,7 @@ import { ref, onMounted, reactive, watch, h } from 'vue' import { useRouter, useRoute } from 'vue-router'; import { message, Button } from 'ant-design-vue' import { ReadFilled, PlusOutlined, AppstoreFilled, LoadingOutlined } from '@ant-design/icons-vue' +import { BookPlus } from 'lucide-vue-next'; import { useConfigStore } from '@/stores/config'; import { useUserStore } from '@/stores/user'; import HeaderComponent from '@/components/HeaderComponent.vue'; diff --git a/web/src/views/LoginView.vue b/web/src/views/LoginView.vue index 7755d270..7d101f4f 100644 --- a/web/src/views/LoginView.vue +++ b/web/src/views/LoginView.vue @@ -1,6 +1,20 @@