diff --git a/apps/api/src/routes/admin/conf.ts b/apps/api/src/routes/admin/conf.ts index f76e282..64141f0 100644 --- a/apps/api/src/routes/admin/conf.ts +++ b/apps/api/src/routes/admin/conf.ts @@ -52,27 +52,19 @@ function isAlive(lastHeartbeat: string) { /** camelCase 契约 ←→ options 表里的 snake_case key */ const OPTION_KEYS = { - websiteBaseUrl: "website_base_url", websiteName: "website_name", - websiteNameShortcut: "website_name_shortcut", - websiteFooter: "website_footer", allowRegister: "allow_register", submissionListShowAll: "submission_list_show_all", classList: "class_list", - enableMaxkb: "enable_maxkb", } as const adminConfRoutes.get("/website", requireSuperAdmin, async (c) => { const options = await getWebsiteOptions() return success(c, { - websiteBaseUrl: options.website_base_url, websiteName: options.website_name, - websiteNameShortcut: options.website_name_shortcut, - websiteFooter: options.website_footer, allowRegister: options.allow_register, submissionListShowAll: options.submission_list_show_all, classList: options.class_list, - enableMaxkb: options.enable_maxkb, } satisfies WebsiteConfig) }) diff --git a/apps/api/src/routes/site.ts b/apps/api/src/routes/site.ts index a2acc8e..b84dba2 100644 --- a/apps/api/src/routes/site.ts +++ b/apps/api/src/routes/site.ts @@ -14,14 +14,10 @@ export const siteRoutes = new Hono() siteRoutes.get("/site", async (c) => { const options = await getWebsiteOptions() return success(c, { - websiteBaseUrl: options.website_base_url, websiteName: options.website_name, - websiteNameShortcut: options.website_name_shortcut, - websiteFooter: options.website_footer, allowRegister: options.allow_register, submissionListShowAll: options.submission_list_show_all, classList: options.class_list, - enableMaxkb: options.enable_maxkb, } satisfies WebsiteConfig) }) diff --git a/apps/api/src/services/options.ts b/apps/api/src/services/options.ts index e56ccfb..4a29731 100644 --- a/apps/api/src/services/options.ts +++ b/apps/api/src/services/options.ts @@ -3,14 +3,10 @@ import { inArray } from "drizzle-orm" import { db, schema } from "../db" export const websiteOptionDefaults = { - website_base_url: "http://127.0.0.1", website_name: "Online Judge", - website_name_shortcut: "oj", - website_footer: "Online Judge Footer", allow_register: true, submission_list_show_all: true, class_list: [] as string[], - enable_maxkb: true, } export async function getOptions(keys: T) { diff --git a/apps/web/src/shared/composables/maxkb.ts b/apps/web/src/shared/composables/maxkb.ts deleted file mode 100644 index 2741466..0000000 --- a/apps/web/src/shared/composables/maxkb.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { useConfigStore } from "shared/store/config" -import { useUserStore } from "shared/store/user" - -/** - * MaxKB 知识库挂件的加载 / 卸载。 - * - * 两个前提同时满足才加载:**已登录**(挂件本身就要登录才能用)且**后台开关打开**。 - * 任一条件变假就把脚本和它建出来的 DOM 一起撤掉。 - * - * 脚本**只在这里注入**。原来 vite 有个 inject-maxkb 插件把