zjk
2026-09-29 54dcf0a82e7490fa58b1c056d5c0b9cb739c2931
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/bootstrap/DataInitializer.java
@@ -15,12 +15,13 @@
import org.springframework.boot.ApplicationRunner;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Component;
import com.tcm.training.admin.common.enums.EnabledStatusEnum;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@Component
//@Component
public class DataInitializer implements ApplicationRunner {
    private final SysUserService sysUserService;
@@ -56,7 +57,7 @@
            user.setUsername("admin");
            user.setNickname("管理员");
            user.setRealName("系统管理员");
            user.setStatus(1);
            user.setStatus(EnabledStatusEnum.ENABLED.getValue());
            user.setDeleted(0);
            user.setPassword(passwordEncoder.encode("Admin@123456"));
            user.setCreatedAt(LocalDateTime.now());
@@ -82,7 +83,7 @@
        role = new SysRole();
        role.setRoleName("超级管理员");
        role.setRoleCode("SUPER_ADMIN");
        role.setStatus(1);
            role.setStatus(EnabledStatusEnum.ENABLED.getValue());
        role.setDeleted(0);
        role.setRemark("默认拥有全部后台权限");
        role.setCreatedAt(LocalDateTime.now());
@@ -324,6 +325,14 @@
                null, null, null, 2, "live:health-popularization:edit", "健康知识编辑按钮"));
        menuIds.add(saveMenu(3123L, 3120L, "删除健康知识", "live_health_popularization_delete", "B",
                null, null, null, 3, "live:health-popularization:delete", "健康知识删除按钮"));
        menuIds.add(saveMenu(6110L, 6100L, "养生科普", "live_health_promotion_manage", "C",
                "/live/promotion/health-promotion", "Live/HealthPromotionList", null, 51, "live:health-promotion:view", "养生科普菜单"));
        menuIds.add(saveMenu(6111L, 6110L, "新增养生科普", "live_health_promotion_add", "B",
                null, null, null, 1, "live:health-promotion:add", "养生科普新增按钮"));
        menuIds.add(saveMenu(6112L, 6110L, "编辑养生科普", "live_health_promotion_edit", "B",
                null, null, null, 2, "live:health-promotion:edit", "养生科普编辑按钮"));
        menuIds.add(saveMenu(6113L, 6110L, "删除养生科普", "live_health_promotion_delete", "B",
                null, null, null, 3, "live:health-promotion:delete", "养生科普删除按钮"));
        menuIds.add(saveMenu(6100L, 3000L, "宣传知识", "live_promotion_root", "M",
                "/live/promotion", null, null, 20, null, "宣传知识目录"));
        menuIds.add(saveMenu(6010L, 6100L, "项目介绍", "live_project_introduction_manage", "C",
@@ -420,7 +429,7 @@
        menu.setComponent(component);
        menu.setIcon(icon);
        menu.setSort(sort);
        menu.setStatus(1);
                menu.setStatus(EnabledStatusEnum.ENABLED.getValue());
        menu.setVisible(1);
        menu.setPermissionKey(permissionKey);
        menu.setRemark(remark);