-- ============================================================= -- APP 版本管理:建表 + 菜单 + 权限节点 -- 表前缀:la_ -- 说明:使用项目本身管理 APP 版本(替代 uni-admin 升级中心) -- ============================================================= -- ---------------------------- -- 1. 创建版本管理表 -- ---------------------------- DROP TABLE IF EXISTS `la_app_version`; CREATE TABLE `la_app_version` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `version_name` varchar(32) NOT NULL DEFAULT '' COMMENT '版本号,如 1.0.12', `version_code` int unsigned NOT NULL DEFAULT 0 COMMENT '版本数字,如 1012', `min_version_code` int unsigned NOT NULL DEFAULT 0 COMMENT '原生最低版本号(wgt时使用,低于此值的整包不允许热更)', `platform` tinyint NOT NULL DEFAULT 1 COMMENT '平台 1=Android 2=iOS', `package_type` tinyint NOT NULL DEFAULT 1 COMMENT '包类型 1=wgt热更 2=apk整包 3=ipa/AppStore', `update_type` tinyint NOT NULL DEFAULT 1 COMMENT '升级类型 1=普通(可跳过) 2=强制 3=静默', `download_url` varchar(500) NOT NULL DEFAULT '' COMMENT '下载地址(wgt/apk链接 或 AppStore链接)', `title` varchar(100) NOT NULL DEFAULT '' COMMENT '更新标题', `update_content` text COMMENT '更新内容(支持换行)', `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 0=禁用 1=启用', `create_time` int unsigned DEFAULT NULL, `update_time` int unsigned DEFAULT NULL, `delete_time` int unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `idx_platform_status` (`platform`, `status`), KEY `idx_version_code` (`version_code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='APP版本管理'; -- ---------------------------- -- 2. 注册后台菜单(pid=158 应用管理) -- ---------------------------- -- 父菜单:版本管理 (M) INSERT INTO `la_system_menu` (`id`, `pid`, `type`, `name`, `icon`, `paths`, `perms`, `component`, `selected`, `params`, `sort`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`) VALUES (542, 158, 'M', '版本管理', 'el-icon-Coin', 'version', '', '', '', '', 110, 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); -- 子菜单:版本列表 (C) INSERT INTO `la_system_menu` (`id`, `pid`, `type`, `name`, `icon`, `paths`, `perms`, `component`, `selected`, `params`, `sort`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`) VALUES (543, 542, 'C', '版本列表', 'el-icon-Document', 'lists', 'app.appVersion/lists', 'app/version/lists/index', '', '', 0, 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); -- 子菜单:版本添加/编辑 (C)(隐藏菜单,仅做路由) INSERT INTO `la_system_menu` (`id`, `pid`, `type`, `name`, `icon`, `paths`, `perms`, `component`, `selected`, `params`, `sort`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`) VALUES (544, 542, 'C', '版本添加/编辑', 'el-icon-Edit', 'lists/edit', 'app.appVersion/add:edit', 'app/version/lists/edit', 'version/lists', '', 0, 0, 0, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); -- 权限节点:新增 / 编辑 / 删除 / 详情 / 修改状态 INSERT INTO `la_system_menu` (`id`, `pid`, `type`, `name`, `icon`, `paths`, `perms`, `component`, `selected`, `params`, `sort`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`) VALUES (545, 543, 'A', '新增', '', '', 'app.appVersion/add', '', '', '', 0, 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()), (546, 543, 'A', '编辑', '', '', 'app.appVersion/edit', '', '', '', 0, 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()), (547, 543, 'A', '删除', '', '', 'app.appVersion/delete', '', '', '', 0, 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()), (548, 543, 'A', '详情', '', '', 'app.appVersion/detail', '', '', '', 0, 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()), (549, 543, 'A', '修改状态', '', '', 'app.appVersion/updateStatus', '', '', '', 0, 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());