feat: 添加注册开关功能,优化系统配置与注册接口
ocs-nuxt / deploy (push) Failing after 11s

This commit is contained in:
2026-05-23 23:48:30 +08:00
parent bc785ac1ce
commit 5e99e28e8b
15 changed files with 371 additions and 48 deletions
+16
View File
@@ -0,0 +1,16 @@
// server/api/auth/register-open.get.ts - 公开接口:查询当前是否开放注册
//
// 该接口无需登录,供前端注册页面展示禁用提示使用。
// 路径位于 /api/auth/** 公开区内,不经过鉴权中间件。
// 不返回任何用户数据或系统敏感信息。
import { apiOk } from "~~/server/utils/response";
import { getSysConfig } from "~~/server/utils/sysConfig";
import type { IRegisterStatusResponse } from "~~/shared/types/settings";
export default defineEventHandler(
async (): Promise<IRegisterStatusResponse> => {
const cfg = await getSysConfig();
return apiOk({ allowRegistration: cfg.allowRegistration });
}
);