feat: 接口统一优化

This commit is contained in:
2026-05-23 13:45:58 +08:00
parent a3b1fba3ea
commit 7d68db723b
20 changed files with 302 additions and 302 deletions
+4 -3
View File
@@ -1,5 +1,6 @@
// server/api/health.get.ts - 服务健康检查接口
import { serverEnv } from "~~/server/utils/env";
import { apiOk } from "~~/server/utils/response";
import { SERVICE_VERSION } from "~~/server/utils/runtimeState";
/**
@@ -9,10 +10,10 @@ import { SERVICE_VERSION } from "~~/server/utils/runtimeState";
* 返回模型名,但不返回 API Key、baseURL 或其他敏感配置
*/
export default defineEventHandler(() => {
return {
status: "ok",
return apiOk({
status: "ok" as const,
message: "AI题库服务运行正常",
version: SERVICE_VERSION,
model: serverEnv.openAiModel
};
});
});