Your Name 5387d6f1d2
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
feat: add style pro canvas workspace
2026-05-16 15:06:12 +08:00

31 lines
779 B
TypeScript

import { NextResponse } from "next/server";
import { getSystemSetting } from "@/lib/db/queries";
import {
STYLE_PRO_CONFIG_KEY,
normalizeStyleProConfig,
toPublicStyleProConfig,
} from "@/lib/style-pro/config";
export const dynamic = "force-dynamic";
export async function GET() {
try {
const setting = await getSystemSetting({ key: STYLE_PRO_CONFIG_KEY }).catch(
() => null
);
const config = normalizeStyleProConfig(setting?.value);
return NextResponse.json({
success: true,
config: toPublicStyleProConfig(config),
});
} catch (error) {
console.error("[Style Pro Config] Failed:", error);
return NextResponse.json(
{ success: false, error: "获取风格化 PRO 配置失败" },
{ status: 500 }
);
}
}