- Pin/unpin posts (PUT /api/posts/:id/pin, admin) with notification to author
- is_pinned/pinned_at in schema; 📌 badge on feed + detail; admin pin button
- Edited marker (已编辑) on feed + detail; edit button + modal for authors
- Custom CSS: upload/delete API + admin tab + global loader (style.css override)
- Fix: duplicate post title on detail page (remove card title, keep header)
- Fix: forum name flicker on load (localStorage cache before fetch)
- Fix: dropdown menu closes on outside click (document listener)
- Fix: document.title + <title> sync on forum rename
// GET /api/custom-css — 公开获取自定义 CSS
|
|
import { readFile } from 'fs/promises';
|
|
import path from 'path';
|
|
|
|
export const runtime = 'nodejs';
|
|
|
|
export async function GET() {
|
|
try {
|
|
const cssPath = path.join(process.cwd(), 'uploads', 'custom', 'style.css');
|
|
const css = await readFile(cssPath, 'utf-8');
|
|
return new Response(css, { headers: { 'Content-Type': 'text/css' } });
|
|
} catch {
|
|
return new Response('', { status: 404 });
|
|
}
|
|
}
|