feat: user signature (设置页编辑 + 帖子底部显示)

- schema: users.signature column (upstream aligned)
- API: posts query JOIN signature, /auth/me returns signature, PUT /users/:id updates signature
- Settings: signature textarea (Markdown hint), saved with profile
- PostDetail: signature shown under post content with divider
- README: remove upstream DB schema note (fixed upstream)
This commit is contained in:
lezi-fun committed 2026-08-10 14:46:05 +08:00
1 parent c8dcf32dd4
commit 694fa2bfaf
6 files changed
+16 -8

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ export async function PUT(req, { params }) {
return Response.json({ error: '无权限修改他人资料' }, { status: 403 });
}
try {
await pool.query('UPDATE users SET username = $1, bio = $2 WHERE id = $3', [username, bio || '', id]);
await pool.query('UPDATE users SET username = $1, bio = $2, signature = $3 WHERE id = $4', [username, bio || '', signature || '', id]);
return Response.json({ success: true });
} catch (err) {
if (err.code === '23505') {