feat: toast notifications, canvas captcha, super admin, mobile fixes
- Toast system (ToastProvider + useToast): right-top colored toasts replace alert for publish success/error; CSS + layout mount - Captcha as canvas image (noise + distortion) in NewPost/ReplyList/ register modal — blocks bots, click to refresh - Super admin: first registered user cannot be demoted (isFirstUser by created_at, DB-agnostic) - Admins can delete others' posts/replies (UI buttons shown for admin) - Mobile: post-actions wrap + compact, feed excerpt 2.5 lines - Fix: missing sun icon in Icons (dark mode toggle showed nothing) - Feed long posts: gradient fade mask instead of line-clamp
This commit is contained in:
1 parent
e860978aef
commit
b2368f68df
12 files changed
+262
-31
No files matched your search
@@ -50,7 +50,8 @@ export default function PostDetail({ postId }) {
|
||||
}
|
||||
|
||||
const time = post.created_at ? new Date(post.created_at).toLocaleString('zh-CN') : '';
|
||||
const canDelete = currentUser && currentUser.id === post.user_id;
|
||||
// 作者本人 或 管理员 可删除/编辑
|
||||
const canDelete = currentUser && (currentUser.id === post.user_id || currentUser.role === 'admin');
|
||||
const canEdit = currentUser && currentUser.id === post.user_id;
|
||||
|
||||
const handleDelete = async () => {
|
||||
|
||||
Reference in new issue
Block a user