diff --git a/app/Http/Controllers/Admin/IndexController.php b/app/Http/Controllers/Admin/IndexController.php index d42888f..e1aa3e9 100644 --- a/app/Http/Controllers/Admin/IndexController.php +++ b/app/Http/Controllers/Admin/IndexController.php @@ -12,7 +12,18 @@ class IndexController extends CommonController public function index() { - return view('admin.index.index'); + $data['menus'] = category_tree(get_category('menu',0)); + + if($_SESSION['admin_user_info']['role_id']==1) + { + + } + else + { + + } + + return view('admin.index.index', $data); } //更新配置 diff --git a/app/Http/Controllers/Admin/MenuController.php b/app/Http/Controllers/Admin/MenuController.php index 37535c9..a22674f 100644 --- a/app/Http/Controllers/Admin/MenuController.php +++ b/app/Http/Controllers/Admin/MenuController.php @@ -22,6 +22,9 @@ class MenuController extends CommonController public function add() { + if(!empty($_GET["pid"])){$pid = $_GET["pid"];}else{$pid=0;} + + $data['pid'] = $pid; $data['menu'] = category_tree(get_category('menu',0)); return view('admin.menu.add', $data); diff --git a/app/Http/Controllers/Admin/UserRoleController.php b/app/Http/Controllers/Admin/UserRoleController.php index 56232fb..b435658 100644 --- a/app/Http/Controllers/Admin/UserRoleController.php +++ b/app/Http/Controllers/Admin/UserRoleController.php @@ -77,4 +77,66 @@ class UserRoleController extends CommonController error_jump('删除失败!请重新提交'); } } + + //角色权限设置视图 + public function permissions() + { + if(!empty($_GET["id"])){$data['role_id'] = $_GET["id"];}else{error_jump('您访问的页面不存在或已被删除!');} + + $menu = []; + $access = DB::table('access')->where('role_id', $data['role_id'])->get(); + if($access) + { + foreach($access as $k=>$v) + { + $menu[] = $v->menu_id; + } + } + + $data['menus'] = category_tree(get_category('menu',0)); + foreach($data['menus'] as $k=>$v) + { + $data['menus'][$k]['is_access'] = 0; + + if(!empty($menu) && in_array($v['id'], $menu)) + { + $data['menus'][$k]['is_access'] = 1; + } + } + + return view('admin.userrole.permissions', $data); + } + + //角色权限设置 + public function dopermissions() + { + $menus = []; + if($_POST['menuid'] && $_POST['role_id']) + { + foreach($_POST['menuid'] as $row) + { + $menus[] = [ + 'role_id' => $_POST['role_id'], + 'menu_id' => $row + ]; + } + } + else + { + error_jump('操作失败!'); + } + DB::beginTransaction(); + DB::table('access')->where('role_id', '=', $_POST['role_id'])->delete(); + + if(DB::table('access')->insert($menus)) + { + DB::commit(); + success_jump('操作成功!'); + } + else + { + DB::rollBack(); + error_jump('操作失败!'); + } + } } diff --git a/lqycms.sql b/lqycms.sql index fcdb990..65ad09f 100644 --- a/lqycms.sql +++ b/lqycms.sql @@ -26,7 +26,7 @@ CREATE TABLE `fl_access` ( /*Data for the table `fl_access` */ -insert into `fl_access`(`role_id`,`menu_id`) values (1,1),(1,2),(1,3),(1,4),(1,9),(1,11),(1,12),(1,18),(1,19),(1,20),(1,21),(1,22),(1,24),(1,26),(1,27),(1,28),(1,29),(1,30),(1,31),(1,32),(1,34),(1,36),(1,35),(1,37),(1,38),(1,39),(1,40),(1,42),(1,43),(1,46),(1,47),(1,121),(1,120),(1,119),(1,118),(1,117),(1,116),(1,115),(1,114),(1,130),(1,129),(1,128),(1,127),(1,126),(1,125),(1,113),(1,112),(1,103),(1,111),(1,110),(1,109),(1,108),(1,107),(1,106),(1,104),(1,103),(1,48),(1,49),(1,50),(1,54),(1,55),(1,57),(1,58),(1,59),(1,60),(1,88),(1,62),(1,63),(1,64),(1,65),(1,66),(1,67),(1,72),(1,73),(1,80),(1,81),(1,82),(1,83),(1,84),(1,85),(1,86),(1,87),(1,89),(1,90),(1,91),(1,92),(1,93),(1,94),(1,95),(1,96),(1,61),(1,97),(1,98),(1,99),(1,105),(1,122),(1,123),(1,124),(1,131),(1,132),(1,133),(1,138),(1,158),(1,163),(1,164),(1,165),(1,166),(1,172),(1,173),(1,198),(1,175),(1,176),(1,178),(1,179),(1,180),(1,181),(1,182),(1,183),(1,177),(1,192),(1,191),(1,197),(1,196),(1,195),(1,193),(1,199),(1,200),(1,201),(1,202),(1,210),(1,211),(1,212),(1,213),(1,214),(1,5),(1,215),(1,216),(1,217),(1,218),(1,6),(1,220),(1,222),(1,223),(1,224),(1,334),(1,226),(1,230),(1,231),(1,335),(1,238),(1,239),(1,240),(1,241),(1,242),(1,243),(1,244),(1,249),(1,253),(1,254),(1,341),(1,257),(1,259),(1,260),(1,261),(1,262),(1,263),(1,264),(1,265),(1,266),(1,267),(1,273),(16,344),(1,303),(16,303),(1,318),(1,319),(1,336),(1,337),(1,338),(1,329),(1,330),(1,1),(1,2),(1,3),(1,4),(1,9),(1,11),(1,12),(1,18),(1,19),(1,20),(1,21),(1,22),(1,24),(1,26),(1,27),(1,28),(1,29),(1,30),(1,31),(1,32),(1,34),(1,36),(1,35),(1,37),(1,38),(1,39),(1,40),(1,42),(1,43),(1,46),(1,47),(1,121),(1,120),(1,119),(1,118),(1,117),(1,116),(1,115),(1,114),(1,130),(1,129),(1,128),(1,127),(1,126),(1,125),(1,113),(1,112),(1,103),(1,111),(1,110),(1,109),(1,108),(1,107),(1,106),(1,104),(1,103),(1,48),(1,49),(1,50),(1,54),(1,55),(1,57),(1,58),(1,59),(1,60),(1,88),(1,62),(1,63),(1,64),(1,65),(1,66),(1,67),(1,72),(1,73),(1,80),(1,81),(1,82),(1,83),(1,84),(1,85),(1,86),(1,87),(1,89),(1,90),(1,91),(1,92),(1,93),(1,94),(1,95),(1,96),(1,61),(1,97),(1,98),(1,99),(1,105),(1,122),(1,123),(1,124),(1,131),(1,132),(1,133),(1,138),(1,158),(1,163),(1,164),(1,165),(1,166),(1,172),(1,173),(1,198),(1,175),(1,176),(1,178),(1,179),(1,180),(1,181),(1,182),(1,183),(1,177),(1,192),(1,191),(1,197),(1,196),(1,195),(1,193),(1,199),(1,200),(1,201),(1,202),(1,210),(1,211),(1,212),(1,213),(1,214),(1,5),(1,215),(1,216),(1,217),(1,218),(1,6),(1,220),(1,222),(1,223),(1,224),(1,334),(1,226),(1,230),(1,231),(1,335),(1,238),(1,239),(1,240),(1,241),(1,242),(1,243),(1,244),(1,249),(1,253),(1,254),(1,256),(1,257),(1,259),(1,260),(1,261),(1,262),(1,263),(1,264),(1,265),(1,266),(1,267),(1,273),(16,163),(16,6),(1,303),(16,1),(1,318),(1,319),(1,336),(1,337),(1,338),(1,329),(1,330),(1,339),(1,340),(1,342),(1,343),(1,344),(1,345),(1,346),(1,347),(1,348),(1,349),(1,350),(1,351),(1,352),(1,353),(1,354),(1,355); +insert into `fl_access`(`role_id`,`menu_id`) values (3,1),(3,11),(3,12),(3,13),(3,14),(3,15),(3,16),(3,17),(3,18),(3,19),(3,20),(3,21),(3,22),(3,23),(3,24),(3,25),(3,32),(3,33),(3,34),(3,35),(3,36),(3,37),(3,6),(3,78),(3,83); /*Table structure for table `fl_arctype` */ @@ -103,26 +103,6 @@ CREATE TABLE `fl_friendlink` ( insert into `fl_friendlink`(`id`,`webname`,`url`,`group_id`,`rank`) values (1,'股票知识','http://www.1104.org/',0,0),(2,'炒股入门知识','http://www.pe7.org/',0,0); -/*Table structure for table `fl_goods_category` */ - -DROP TABLE IF EXISTS `fl_goods_category`; - -CREATE TABLE `fl_goods_category` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `shop_id` int(11) NOT NULL COMMENT '商家id', - `cat_name` varchar(90) NOT NULL DEFAULT '', - `keywords` varchar(255) NOT NULL DEFAULT '', - `parent_id` smallint(5) unsigned NOT NULL DEFAULT '0', - `sort_order` tinyint(1) unsigned NOT NULL DEFAULT '50', - `is_show` tinyint(1) unsigned NOT NULL DEFAULT '1', - `thumb` varchar(255) NOT NULL, - `attr_id` int(11) NOT NULL COMMENT '关联的属性类型', - PRIMARY KEY (`id`), - KEY `parent_id` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - -/*Data for the table `fl_goods_category` */ - /*Table structure for table `fl_guestbook` */ DROP TABLE IF EXISTS `fl_guestbook`; @@ -176,11 +156,11 @@ CREATE TABLE `fl_menu` ( PRIMARY KEY (`id`), KEY `status` (`status`), KEY `parentid` (`pid`) -) ENGINE=MyISAM AUTO_INCREMENT=188 DEFAULT CHARSET=utf8 COMMENT='后台菜单表'; +) ENGINE=MyISAM AUTO_INCREMENT=104 DEFAULT CHARSET=utf8 COMMENT='后台菜单表'; /*Data for the table `fl_menu` */ -insert into `fl_menu`(`id`,`pid`,`action`,`data`,`type`,`status`,`name`,`icon`,`des`,`listorder`) values (1,0,'default','',0,1,'内容管理','th','',30),(2,1,'index','',1,1,'所有留言','','',0),(3,2,'delete','',1,0,'删除网站留言','','',0),(4,1,'index','',1,1,'评论管理','','',0),(5,4,'delete','',1,0,'删除评论','','',0),(6,4,'check','',1,0,'评论审核','','',0),(7,1,'index','',1,1,'文章管理','','',1),(8,7,'listorders','',1,0,'文章排序','','',0),(9,7,'top','',1,0,'文章置顶','','',0),(10,7,'recommend','',1,0,'文章推荐','','',0),(11,7,'move','',1,0,'批量移动','','',1000),(12,7,'check','',1,0,'文章审核','','',1000),(13,7,'delete','',1,0,'删除文章','','',1000),(14,7,'edit','',1,0,'编辑文章','','',1000),(15,14,'edit_post','',1,0,'提交编辑','','',0),(16,7,'add','',1,0,'添加文章','','',1000),(17,16,'add_post','',1,0,'提交添加','','',0),(18,1,'index','',0,1,'分类管理','','',2),(19,18,'listorders','',1,0,'文章分类排序','','',0),(20,18,'delete','',1,0,'删除分类','','',1000),(21,18,'edit','',1,0,'编辑分类','','',1000),(22,21,'edit_post','',1,0,'提交编辑','','',0),(23,18,'add','',1,0,'添加分类','','',1000),(24,23,'add_post','',1,0,'提交添加','','',0),(25,1,'index','',1,1,'页面管理','','',3),(26,25,'listorders','',1,0,'页面排序','','',0),(27,25,'delete','',1,0,'删除页面','','',1000),(28,25,'edit','',1,0,'编辑页面','','',1000),(29,28,'edit_post','',1,0,'提交编辑','','',0),(30,25,'add','',1,0,'添加页面','','',1000),(31,30,'add_post','',1,0,'提交添加','','',0),(32,1,'default','',1,1,'回收站','','',4),(33,32,'recyclebin','',1,1,'文章回收','','',0),(34,33,'restore','',1,0,'文章还原','','',1000),(35,33,'clean','',1,0,'彻底删除','','',1000),(36,32,'recyclebin','',1,1,'页面回收','','',1),(37,36,'clean','',1,0,'彻底删除','','',1000),(38,36,'restore','',1,0,'页面还原','','',1000),(39,0,'default','',0,1,'扩展工具','cloud','',40),(40,39,'default','',1,0,'备份管理','','',0),(41,40,'restore','',1,1,'数据还原','','',0),(42,40,'index','',1,1,'数据备份','','',0),(43,42,'index_post','',1,0,'提交数据备份','','',0),(44,40,'download','',1,0,'下载备份','','',1000),(45,40,'del_backup','',1,0,'删除备份','','',1000),(46,40,'import','',1,0,'数据备份导入','','',1000),(47,39,'index','',1,1,'插件管理','','',0),(48,47,'toggle','',1,0,'插件启用切换','','',0),(49,47,'setting','',1,0,'插件设置','','',0),(50,49,'setting_post','',1,0,'插件设置提交','','',0),(51,47,'install','',1,0,'插件安装','','',0),(52,47,'uninstall','',1,0,'插件卸载','','',0),(53,39,'default','',1,1,'幻灯片','','',1),(54,53,'index','',1,1,'幻灯片管理','','',0),(55,54,'listorders','',1,0,'幻灯片排序','','',0),(56,54,'toggle','',1,0,'幻灯片显示切换','','',0),(57,54,'delete','',1,0,'删除幻灯片','','',1000),(58,54,'edit','',1,0,'编辑幻灯片','','',1000),(59,58,'edit_post','',1,0,'提交编辑','','',0),(60,54,'add','',1,0,'添加幻灯片','','',1000),(61,60,'add_post','',1,0,'提交添加','','',0),(62,53,'index','',1,1,'幻灯片分类','','',0),(63,62,'delete','',1,0,'删除分类','','',1000),(64,62,'edit','',1,0,'编辑分类','','',1000),(65,64,'edit_post','',1,0,'提交编辑','','',0),(66,62,'add','',1,0,'添加分类','','',1000),(67,66,'add_post','',1,0,'提交添加','','',0),(68,39,'index','',1,1,'网站广告','','',2),(69,68,'toggle','',1,0,'广告显示切换','','',0),(70,68,'delete','',1,0,'删除广告','','',1000),(71,68,'edit','',1,0,'编辑广告','','',1000),(72,71,'edit_post','',1,0,'提交编辑','','',0),(73,68,'add','',1,0,'添加广告','','',1000),(74,73,'add_post','',1,0,'提交添加','','',0),(75,39,'index','',0,1,'友情链接','','',3),(76,75,'listorders','',1,0,'友情链接排序','','',0),(77,75,'toggle','',1,0,'友链显示切换','','',0),(78,75,'delete','',1,0,'删除友情链接','','',1000),(79,75,'edit','',1,0,'编辑友情链接','','',1000),(80,79,'edit_post','',1,0,'提交编辑','','',0),(81,75,'add','',1,0,'添加友情链接','','',1000),(82,81,'add_post','',1,0,'提交添加','','',0),(83,39,'setting','',1,1,'第三方登陆','leaf','',4),(84,83,'setting_post','',1,0,'提交设置','','',0),(85,0,'default','',1,1,'菜单管理','list','',20),(86,85,'default1','',1,1,'前台菜单','','',0),(87,86,'index','',1,1,'菜单管理','','',0),(88,87,'listorders','',1,0,'前台导航排序','','',0),(89,87,'delete','',1,0,'删除菜单','','',1000),(90,87,'edit','',1,0,'编辑菜单','','',1000),(91,90,'edit_post','',1,0,'提交编辑','','',0),(92,87,'add','',1,0,'添加菜单','','',1000),(93,92,'add_post','',1,0,'提交添加','','',0),(94,86,'index','',1,1,'菜单分类','','',0),(95,94,'delete','',1,0,'删除分类','','',1000),(96,94,'edit','',1,0,'编辑分类','','',1000),(97,96,'edit_post','',1,0,'提交编辑','','',0),(98,94,'add','',1,0,'添加分类','','',1000),(99,98,'add_post','',1,0,'提交添加','','',0),(100,85,'index','',1,1,'后台菜单','','',0),(101,100,'add','',1,0,'添加菜单','','',0),(102,101,'add_post','',1,0,'提交添加','','',0),(103,100,'listorders','',1,0,'后台菜单排序','','',0),(104,100,'export_menu','',1,0,'菜单备份','','',1000),(105,100,'edit','',1,0,'编辑菜单','','',1000),(106,105,'edit_post','',1,0,'提交编辑','','',0),(107,100,'delete','',1,0,'删除菜单','','',1000),(108,100,'lists','',1,0,'所有菜单','','',1000),(109,0,'default','',0,1,'设置','cogs','',0),(110,109,'userdefault','',0,1,'个人信息','','',0),(111,110,'userinfo','',1,1,'修改信息','','',0),(112,111,'userinfo_post','',1,0,'修改信息提交','','',0),(113,110,'password','',1,1,'修改密码','','',0),(114,113,'password_post','',1,0,'提交修改','','',0),(115,109,'site','',1,1,'网站信息','','',0),(116,115,'site_post','',1,0,'提交修改','','',0),(117,115,'index','',1,0,'路由列表','','',0),(118,115,'add','',1,0,'路由添加','','',0),(119,118,'add_post','',1,0,'路由添加提交','','',0),(120,115,'edit','',1,0,'路由编辑','','',0),(121,120,'edit_post','',1,0,'路由编辑提交','','',0),(122,115,'delete','',1,0,'路由删除','','',0),(123,115,'ban','',1,0,'路由禁止','','',0),(124,115,'open','',1,0,'路由启用','','',0),(125,115,'listorders','',1,0,'路由排序','','',0),(126,109,'default','',1,1,'邮箱配置','','',0),(127,126,'index','',1,1,'SMTP配置','','',0),(128,127,'index_post','',1,0,'提交配置','','',0),(129,126,'active','',1,1,'注册邮件模板','','',0),(130,129,'active_post','',1,0,'提交模板','','',0),(131,109,'clearcache','',1,1,'清除缓存','','',1),(132,0,'default','',1,1,'用户管理','group','',10),(133,132,'default1','',1,1,'用户组','','',0),(134,133,'index','',1,1,'本站用户','leaf','',0),(135,134,'ban','',1,0,'拉黑会员','','',0),(136,134,'cancelban','',1,0,'启用会员','','',0),(137,133,'index','',1,1,'第三方用户','leaf','',0),(138,137,'delete','',1,0,'第三方用户解绑','','',0),(139,132,'default3','',1,1,'管理组','','',0),(140,139,'index','',1,1,'角色管理','','',0),(141,140,'member','',1,0,'成员管理','','',1000),(142,140,'authorize','',1,0,'权限设置','','',1000),(143,142,'authorize_post','',1,0,'提交设置','','',0),(144,140,'roleedit','',1,0,'编辑角色','','',1000),(145,144,'roleedit_post','',1,0,'提交编辑','','',0),(146,140,'roledelete','',1,1,'删除角色','','',1000),(147,140,'roleadd','',1,1,'添加角色','','',1000),(148,147,'roleadd_post','',1,0,'提交添加','','',0),(149,139,'index','',1,1,'管理员','','',0),(150,149,'delete','',1,0,'删除管理员','','',1000),(151,149,'edit','',1,0,'管理员编辑','','',1000),(152,151,'edit_post','',1,0,'编辑提交','','',0),(153,149,'add','',1,0,'管理员添加','','',1000),(154,153,'add_post','',1,0,'添加提交','','',0),(155,47,'update','',1,0,'插件更新','','',0),(156,109,'index','',1,1,'文件存储','','',0),(157,156,'setting_post','',1,0,'文件存储设置提交','','',0),(158,54,'ban','',1,0,'禁用幻灯片','','',0),(159,54,'cancelban','',1,0,'启用幻灯片','','',0),(160,149,'ban','',1,0,'禁用管理员','','',0),(161,149,'cancelban','',1,0,'启用管理员','','',0),(166,127,'test','',1,0,'测试邮件','','',0),(167,109,'upload','',1,1,'上传设置','','',0),(168,167,'upload_post','',1,0,'上传设置提交','','',0),(169,7,'copy','',1,0,'文章批量复制','','',0),(174,100,'backup_menu','',1,0,'备份菜单','','',0),(175,100,'export_menu_lang','',1,0,'导出后台菜单多语言包','','',0),(176,100,'restore_menu','',1,0,'还原菜单','','',0),(177,100,'getactions','',1,0,'导入新菜单','','',0),(187,1,'sdfsadf2','sadfsa2',0,1,'sda2','sadf2','sdf2',0); +insert into `fl_menu`(`id`,`pid`,`action`,`data`,`type`,`status`,`name`,`icon`,`des`,`listorder`) values (1,0,'article_default','',0,0,'文章管理','glyphicon glyphicon-text-color','',0),(6,0,'sysconfig_default','',0,0,'设置','glyphicon glyphicon-wrench','',1000),(3,0,'menu_default','',0,0,'菜单管理','glyphicon glyphicon-menu-hamburger','',20),(4,0,'user_default','',0,0,'用户管理','glyphicon glyphicon-user','',30),(2,0,'product_default','',0,0,'商品管理','glyphicon glyphicon-euro','',10),(5,0,'extension_default','',0,0,'批量维护','glyphicon glyphicon-cloud','',40),(7,5,'admin_jump','',1,0,'页面跳转','','',0),(8,5,'admin','',1,0,'后台首页','','',0),(9,5,'admin_index_upconfig','',1,0,'更新系统参数配置','','',0),(10,5,'admin_index_upcache','',1,0,'更新缓存','','',0),(11,1,'admin_article','',1,1,'文章列表','','',0),(12,1,'admin_article_add','',1,1,'发布文章','','',0),(13,12,'admin_article_doadd','',1,0,'发布文章提交','','',0),(14,1,'admin_article_edit','',1,0,'文章修改','','',0),(15,14,'admin_article_doedit','',1,0,'文章修改提交','','',0),(16,1,'admin_article_del','',1,0,'文章删除','','',0),(17,1,'admin_article_repetarc','',1,1,'重复文档检测','','',0),(18,1,'admin_article_recommendarc','',1,0,'文章推荐','','',0),(19,1,'admin_article_articleexists','',1,0,'文章是否存在','','',0),(20,1,'admin_category','',1,1,'文章栏目','','',0),(21,20,'admin_category_add','',1,0,'文章栏目添加','','',0),(22,21,'admin_category_doadd','',1,0,'文章栏目添加提交','','',0),(23,20,'admin_category_edit','',1,0,'文章栏目修改','','',0),(24,23,'admin_category_doedit','',1,0,'文章栏目修改提交','','',0),(25,20,'admin_category_del','',1,0,'文章栏目删除','','',0),(26,5,'admin_tag','',1,1,'Tag标签管理','','',0),(27,26,'admin_tag_add','',1,0,'Tag标签添加','','',0),(28,27,'admin_tag_doadd','',1,0,'Tag标签添加提交','','',0),(29,26,'admin_tag_edit','',1,0,'Tag标签修改','','',0),(30,29,'admin_tag_doedit','',1,0,'Tag标签修改提交','','',0),(31,26,'admin_tag_del','',1,0,'Tag标签删除','','',0),(32,1,'admin_page','',1,1,'单页管理','','',0),(33,32,'admin_page_add','',1,0,'单页添加','','',0),(34,33,'admin_page_doadd','',1,0,'单页添加提交','','',0),(35,32,'admin_page_edit','',1,0,'单页修改','','',0),(36,35,'admin_page_doedit','',1,0,'单页修改提交','','',0),(37,32,'admin_page_del','',1,0,'单页删除','','',0),(38,2,'admin_product','',1,1,'商品列表','','',0),(39,2,'admin_product_add','',1,1,'商品添加','','',0),(40,39,'admin_product_doadd','',1,0,'商品添加提交','','',0),(41,2,'admin_product_edit','',1,0,'商品修改','','',0),(42,41,'admin_product_doedit','',1,0,'商品修改提交','','',0),(43,2,'admin_product_del','',1,0,'商品删除','','',0),(44,2,'admin_product_recommendarc','',1,0,'重复商品','','',0),(45,2,'admin_product_productexists','',1,0,'商品是否存在','','',0),(46,2,'admin_producttype','',1,1,'商品分类','','',0),(47,46,'admin_producttype_add','',1,1,'商品分类添加','','',0),(48,47,'admin_producttype_doadd','',1,0,'商品分类添加提交','','',0),(49,46,'admin_producttype_edit','',1,0,'商品分类修改','','',0),(50,42,'admin_producttype_doedit','',1,0,'商品分类修改提交','','',0),(51,46,'admin_producttype_del','',1,0,'商品分类删除','','',0),(52,5,'admin_friendlink','',1,1,'友情链接','','',0),(53,52,'admin_friendlink_add','',1,0,'友情链接添加','','',0),(54,53,'admin_friendlink_doadd','',1,0,'友情链接添加提交','','',0),(55,52,'admin_friendlink_edit','',1,0,'友情链接修改','','',0),(56,55,'admin_friendlink_doedit','',1,0,'友情链接修改提交','','',0),(57,52,'admin_friendlink_del','',1,0,'友情链接删除','','',0),(58,5,'admin_keyword','',1,1,'关键词管理','','',0),(59,58,'admin_keyword_add','',1,0,'关键词添加','','',0),(60,59,'admin_keyword_doadd','',1,0,'关键词添加提交','','',0),(61,58,'admin_keyword_edit','',1,0,'关键词修改','','',0),(62,61,'admin_keyword_doedit','',1,0,'关键词修改提交','','',0),(63,58,'admin_keyword_del','',1,0,'关键词删除','','',0),(64,5,'admin_searchword','',1,1,'搜索关键词','','',0),(65,64,'admin_searchword_add','',1,0,'搜索关键词添加','','',0),(66,65,'admin_searchword_doadd','',1,0,'搜索关键词添加提交','','',0),(67,64,'admin_searchword_edit','',1,0,'搜索关键词修改','','',0),(68,67,'admin_searchword_doedit','',1,0,'搜索关键词修改提交','','',0),(69,64,'admin_searchword_del','',1,0,'搜索关键词删除','','',0),(70,5,'admin_slide','',1,1,'轮播图','','',0),(71,70,'admin_slide_add','',1,0,'轮播图添加','','',0),(72,71,'admin_slide_doadd','',1,0,'轮播图添加提交','','',0),(73,70,'admin_slide_edit','',1,0,'轮播图修改','','',0),(74,73,'admin_slide_doedit','',1,0,'轮播图修改提交','','',0),(75,70,'admin_slide_del','',1,0,'轮播图删除','','',0),(76,5,'admin_guestbook','',1,1,'在线留言','','',0),(77,76,'admin_guestbook_del','',1,0,'在线留言删除','','',0),(78,6,'admin_sysconfig','',1,1,'系统基本参数','','',0),(79,78,'admin_sysconfig_add','',1,0,'系统参数添加','','',0),(80,79,'admin_sysconfig_doadd','',1,0,'系统参数添加提交','','',0),(81,78,'admin_sysconfig_edit','',1,0,'系统参数修改','','',0),(82,81,'admin_sysconfig_doedit','',1,0,'系统参数修改提交','','',0),(83,78,'admin_sysconfig_del','',1,0,'系统参数删除','','',0),(84,4,'admin_user','',1,1,'管理员','','',0),(85,84,'admin_user_add','',1,0,'管理员添加','','',0),(86,85,'admin_user_doadd','',1,0,'管理员添加提交','','',0),(87,84,'admin_user_edit','',1,0,'管理员修改','','',0),(88,87,'admin_user_doedit','',1,0,'管理员修改提交','','',0),(89,84,'admin_user_del','',1,0,'管理员删除','','',0),(90,4,'admin_userrole','',1,1,'角色管理','','',0),(91,90,'admin_userrole_add','',1,0,'角色添加','','',0),(92,91,'admin_userrole_doadd','',1,0,'角色添加修改','','',0),(93,90,'admin_userrole_edit','',1,0,'角色修改','','',0),(94,93,'admin_userrole_doedit','',1,0,'角色修改提交','','',0),(95,90,'admin_userrole_del','',1,0,'角色删除','','',0),(96,3,'admin_menu','',1,1,'后台菜单','','',0),(97,96,'admin_menu_add','',1,0,'菜单添加','','',0),(98,97,'admin_menu_doadd','',1,0,'菜单添加提交','','',0),(99,96,'admin_menu_edit','',1,0,'菜单修改','','',0),(100,99,'admin_menu_doedit','',1,0,'菜单修改提交','','',0),(101,96,'admin_menu_del','',1,0,'菜单删除','','',0),(102,90,'admin_userrole_permissions','',1,0,'权限设置','','',0),(103,102,'admin_userrole_dopermissions','',1,0,'权限设置提交','','',0); /*Table structure for table `fl_order` */ @@ -521,61 +501,7 @@ CREATE TABLE `fl_user_role` ( /*Data for the table `fl_user_role` */ -insert into `fl_user_role`(`id`,`name`,`des`,`status`,`pid`,`listorder`) values (1,'超级管理员','拥有网站最高管理员权限!',0,0,0),(3,'撒地方','双方的股份富商大贾',0,0,0); - -/*Table structure for table `think_access` */ - -DROP TABLE IF EXISTS `think_access`; - -CREATE TABLE `think_access` ( - `role_id` smallint(6) unsigned NOT NULL, - `node_id` smallint(6) unsigned NOT NULL, - `level` tinyint(1) NOT NULL, - `module` varchar(50) DEFAULT NULL, - KEY `groupId` (`role_id`), - KEY `nodeId` (`node_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -/*Data for the table `think_access` */ - -/*Table structure for table `think_node` */ - -DROP TABLE IF EXISTS `think_node`; - -CREATE TABLE `think_node` ( - `id` smallint(6) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(20) NOT NULL, - `title` varchar(50) DEFAULT NULL, - `status` tinyint(1) DEFAULT '0', - `remark` varchar(255) DEFAULT NULL, - `sort` smallint(6) unsigned DEFAULT NULL, - `pid` smallint(6) unsigned NOT NULL, - `level` tinyint(1) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `level` (`level`), - KEY `pid` (`pid`), - KEY `status` (`status`), - KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -/*Data for the table `think_node` */ - -/*Table structure for table `think_role` */ - -DROP TABLE IF EXISTS `think_role`; - -CREATE TABLE `think_role` ( - `id` smallint(6) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(20) NOT NULL, - `pid` smallint(6) DEFAULT NULL, - `status` tinyint(1) unsigned DEFAULT NULL, - `remark` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `pid` (`pid`), - KEY `status` (`status`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -/*Data for the table `think_role` */ +insert into `fl_user_role`(`id`,`name`,`des`,`status`,`pid`,`listorder`) values (1,'超级管理员','拥有网站最高管理员权限!',0,0,0),(3,'普通角色','',0,0,0); /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; diff --git a/resources/views/admin/article/add.blade.php b/resources/views/admin/article/add.blade.php index c8bacc8..c2d0e16 100644 --- a/resources/views/admin/article/add.blade.php +++ b/resources/views/admin/article/add.blade.php @@ -110,7 +110,7 @@ function upImage() -    +    diff --git a/resources/views/admin/menu/add.blade.php b/resources/views/admin/menu/add.blade.php index 5b57246..4a8735b 100644 --- a/resources/views/admin/menu/add.blade.php +++ b/resources/views/admin/menu/add.blade.php @@ -15,8 +15,11 @@ diff --git a/resources/views/admin/menu/index.blade.php b/resources/views/admin/menu/index.blade.php index 1acbbff..b940384 100644 --- a/resources/views/admin/menu/index.blade.php +++ b/resources/views/admin/menu/index.blade.php @@ -20,7 +20,7 @@ name; ?> action; ?> status==1){echo '显示';}else{echo '隐藏';} ?> -修改 | 删除 +添加子菜单 | 修改 | 删除 diff --git a/resources/views/admin/userrole/index.blade.php b/resources/views/admin/userrole/index.blade.php index 4cd6aba..2f65dfc 100644 --- a/resources/views/admin/userrole/index.blade.php +++ b/resources/views/admin/userrole/index.blade.php @@ -20,7 +20,7 @@ name; ?> des; ?> status==0){echo '启用';}else{echo '禁用';} ?> -权限设置 | 修改 | 删除 +id<>1){ ?>权限设置 | 修改 | 删除 diff --git a/resources/views/admin/userrole/permissions.blade.php b/resources/views/admin/userrole/permissions.blade.php new file mode 100644 index 0000000..e7879ba --- /dev/null +++ b/resources/views/admin/userrole/permissions.blade.php @@ -0,0 +1,67 @@ +角色权限设置_后台管理@include('admin.common.header') +
+
+ + +
+

角色权限设置

[ 角色列表 ]

+ +
{{ csrf_field() }} + +
    + +
  • ">'; ?> name='menuid[]' value='' level='' onclick='javascript:checknode(this);'>
  • + +
+ +

+
+ + +
+ \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 5cceb14..88490d4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -156,6 +156,8 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w Route::get('/userrole/edit', 'UserRoleController@edit')->name('admin_userrole_edit'); Route::post('/userrole/doedit', 'UserRoleController@doedit')->name('admin_userrole_doedit'); Route::get('/userrole/del', 'UserRoleController@del')->name('admin_userrole_del'); + Route::get('/userrole/permissions', 'UserRoleController@permissions')->name('admin_userrole_permissions'); //权限设置 + Route::post('/userrole/dopermissions', 'UserRoleController@dopermissions')->name('admin_userrole_dopermissions'); //菜单管理 Route::get('/menu', 'MenuController@index')->name('admin_menu'); Route::get('/menu/add', 'MenuController@add')->name('admin_menu_add');