feat: allow editing community post content

This commit is contained in:
hajimi
2026-08-02 20:11:15 +08:00
parent 115a859dd3
commit 71f3b1c6d7
7 changed files with 125 additions and 2 deletions
@@ -0,0 +1,24 @@
SET @post_menu_id = COALESCE(
(SELECT `id` FROM `la_system_menu` WHERE `perms` = 'community.communityPost/lists' LIMIT 1),
(SELECT `id` FROM `la_system_menu` WHERE `component` = 'community/post/index' LIMIT 1)
);
INSERT INTO `la_system_menu`
(`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`)
SELECT
@post_menu_id, 'A', '编辑内容', '', 0, 'community.communityPost/editContent', '', '', '', '', 0, 0, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()
WHERE @post_menu_id IS NOT NULL
AND NOT EXISTS (
SELECT 1 FROM `la_system_menu` WHERE `perms` = 'community.communityPost/editContent'
);
INSERT INTO `la_system_role_menu` (`role_id`, `menu_id`)
SELECT 1, menu.`id`
FROM `la_system_menu` menu
WHERE menu.`perms` = 'community.communityPost/editContent'
AND NOT EXISTS (
SELECT 1
FROM `la_system_role_menu` role_menu
WHERE role_menu.`role_id` = 1
AND role_menu.`menu_id` = menu.`id`
);