diff --git a/application/admin/behavior/AdminLog.php b/application/admin/behavior/AdminLog.php new file mode 100644 index 00000000..26d4e6dc --- /dev/null +++ b/application/admin/behavior/AdminLog.php @@ -0,0 +1,18 @@ +isPost()) + { + \app\admin\model\AdminLog::record(); + } + } + +} diff --git a/application/admin/command/Install/fastadmin.sql b/application/admin/command/Install/fastadmin.sql index c6812abb..5708a867 100644 --- a/application/admin/command/Install/fastadmin.sql +++ b/application/admin/command/Install/fastadmin.sql @@ -4,7 +4,7 @@ 官网: http://www.fastadmin.net 演示: http://demo.fastadmin.net - Date: 04/15/2017 00:15:20 AM + Date: 05/21/2017 14315:20 AM */ SET FOREIGN_KEY_CHECKS = 0; @@ -35,7 +35,7 @@ CREATE TABLE `fa_admin` ( -- Records of `fa_admin` -- ---------------------------- BEGIN; -INSERT INTO `fa_admin` VALUES ('1', 'admin', 'Admin', '075eaec83636846f51c152f29b98a2fd', 's4f3', '/assets/img/avatar.png', 'admin@fastadmin.net', '0', '1492185129', '1492186163', '1492185129', '6780cd73-f650-4627-9371-60d3739f4e77', 'normal'), ('2', 'admin2', 'admin2', '9a28ce07ce875fbd14172a9ca5357d3c', '2dHDmj', '/assets/img/avatar.png', 'admin2@fastadmin.net', '0', '0', '1492186163', '1492186163', '', 'normal'), ('3', 'admin3', 'admin3', '1c11f945dfcd808a130a8c2a8753fe62', 'WOKJEn', '/assets/img/avatar.png', 'admin3@fastadmin.net', '0', '0', '1492186201', '1492186201', '', 'normal'), ('4', 'admin22', 'admin22', '1c1a0aa0c3c56a8c1a908aab94519648', 'Aybcn5', '/assets/img/avatar.png', 'admin22@fastadmin.net', '0', '0', '1492186240', '1492186240', '', 'normal'), ('5', 'admin32', 'admin32', 'ade94d5d7a7033afa7d84ac3066d0a02', 'FvYK0u', '/assets/img/avatar.png', 'admin32@fastadmin.net', '0', '0', '1492186263', '1492186263', '', 'normal'); +INSERT INTO `fa_admin` VALUES ('1', 'admin', 'Admin', '075eaec83636846f51c152f29b98a2fd', 's4f3', '/assets/img/avatar.png', 'admin@fastadmin.net', '0', '0', '1492186163', '1495347600', '', 'normal'), ('2', 'admin2', 'admin2', '9a28ce07ce875fbd14172a9ca5357d3c', '2dHDmj', '/assets/img/avatar.png', 'admin2@fastadmin.net', '0', '0', '1492186163', '1492186163', '', 'normal'), ('3', 'admin3', 'admin3', '1c11f945dfcd808a130a8c2a8753fe62', 'WOKJEn', '/assets/img/avatar.png', 'admin3@fastadmin.net', '0', '0', '1492186201', '1492186201', '', 'normal'), ('4', 'admin22', 'admin22', '1c1a0aa0c3c56a8c1a908aab94519648', 'Aybcn5', '/assets/img/avatar.png', 'admin22@fastadmin.net', '0', '0', '1492186240', '1492186240', '', 'normal'), ('5', 'admin32', 'admin32', 'ade94d5d7a7033afa7d84ac3066d0a02', 'FvYK0u', '/assets/img/avatar.png', 'admin32@fastadmin.net', '0', '0', '1492186263', '1492186263', '', 'normal'); COMMIT; -- ---------------------------- @@ -49,10 +49,12 @@ CREATE TABLE `fa_admin_log` ( `url` varchar(100) NOT NULL DEFAULT '' COMMENT '操作页面', `title` varchar(100) NOT NULL DEFAULT '' COMMENT '日志标题', `content` text NOT NULL COMMENT '内容', + `ip` varchar(50) NOT NULL DEFAULT '' COMMENT 'IP', + `useragent` varchar(255) NOT NULL DEFAULT '' COMMENT 'User-Agent', `createtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '操作时间', PRIMARY KEY (`id`), KEY `name` (`username`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='管理员日志表'; +) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='管理员日志表'; -- ---------------------------- -- Table structure for `fa_article` @@ -96,7 +98,14 @@ CREATE TABLE `fa_attachment` ( `sha1` varchar(40) NOT NULL DEFAULT '' COMMENT '文件 sha1编码', PRIMARY KEY (`id`), UNIQUE KEY `sha1` (`sha1`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='附件表'; +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='附件表'; + +-- ---------------------------- +-- Records of `fa_attachment` +-- ---------------------------- +BEGIN; +INSERT INTO `fa_attachment` VALUES ('1', '/uploads/20170520/81c791c0b84edf167b233a7917119399.jpg', '500', '356', 'jpg', '0', '120891', 'image/jpeg', '', '1495270641', '1495270641', '1495270641', '92be279c3cf306b65b8ac46964d7986552ee5449'), ('2', '/uploads/20170520/85aae95c4373e792d422b4c6a453d07b.jpg', '600', '401', 'jpg', '0', '86257', 'image/jpeg', '', '1495270673', '1495270673', '1495270673', '8a3fa16c5623af5134fc5f063e40962920785b59'), ('3', '/uploads/20170520/a67cfec11b4dd895eedc33a58aaa8bba.jpg', '420', '315', 'jpg', '0', '19076', 'image/jpeg', '', '1495270783', '1495270783', '1495270784', 'b2a30fc250d462ad7a450c43019279268f741a7c'), ('4', '/uploads/20170520/cbd11475b0cd64d7d02956070226e964.jpg', '500', '333', 'jpg', '0', '31768', 'image/jpeg', '', '1495270790', '1495270790', '1495270790', '99925d7cd560d32b6b1d6c03abe71f5496f3a216'), ('5', '/uploads/20170520/a82004ccabbacff58213459013bd2458.jpg', '500', '334', 'jpg', '0', '41465', 'image/jpeg', '', '1495270810', '1495270810', '1495270810', '2748fb122e5e42b37abae578bf9244476b31b29a'), ('6', '/uploads/20170520/6c3618d7d4c03a00931f091677d0bb98.jpg', '600', '401', 'jpg', '0', '52952', 'image/jpeg', '', '1495270817', '1495270817', '1495270817', 'd9ad6ac645fdf8bcc2bf7a519d4e54acedb54861'), ('7', '/uploads/20170520/0bc9cd023e0de3c943f29eafa8ae5da9.jpg', '510', '397', 'jpg', '0', '43517', 'image/jpeg', '', '1495270866', '1495270866', '1495270866', 'c2b810bceded447d30ed556a4429da8cb78dfd11'), ('8', '/uploads/20170520/0a67e00f5dc18d3b4098617be6e8fb4a.jpg', '500', '333', 'jpg', '0', '97654', 'image/jpeg', '', '1495271110', '1495271110', '1495271110', 'df39da0f5bff78e72bee7aec2c60161b3239f6e1'), ('9', '/uploads/20170520/5fa1f64bc1bc4c0e0279591df3ec9699.jpg', '600', '511', 'jpg', '0', '76951', 'image/jpeg', '', '1495271716', '1495271716', '1495271716', '53c4a8c3c40c3f5b79ea8d9b99719fac522bf1ef'), ('10', '/uploads/20170520/fdb91b442e627cb3a8388386ca14e03d.jpg', '510', '364', 'jpg', '0', '41151', 'image/jpeg', '', '1495273057', '1495273057', '1495273057', '600fca07ebfc7769c880e2fb4c19bad26f04d1dd'); +COMMIT; -- ---------------------------- -- Table structure for `fa_auth_group` @@ -161,13 +170,13 @@ CREATE TABLE `fa_auth_rule` ( UNIQUE KEY `name` (`name`) USING BTREE, KEY `pid` (`pid`), KEY `weigh` (`weigh`) -) ENGINE=InnoDB AUTO_INCREMENT=10491 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='节点表'; +) ENGINE=InnoDB AUTO_INCREMENT=10537 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='节点表'; -- ---------------------------- -- Records of `fa_auth_rule` -- ---------------------------- BEGIN; -INSERT INTO `fa_auth_rule` VALUES ('10400', 'file', '0', '/admin/dashboard', '控制台', 'fa fa-dashboard', '', '用于展示当前系统中的统计数据、统计报表及重要实时数据\r\n', '1', '1491655325', '1492184975', '0', 'normal'), ('10401', 'file', '10400', '/admin/dashboard/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10402', 'file', '10400', '/admin/dashboard/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10403', 'file', '10400', '/admin/dashboard/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10404', 'file', '10400', '/admin/dashboard/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10405', 'file', '10400', '/admin/dashboard/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10406', 'file', '0', '/admin/page', '单页管理', 'fa fa-tags', '', '用于管理普通的单页面,通常用于关于我们、联系我们、商务合作等单一页面\r\n', '1', '1491655325', '1494259768', '0', 'normal'), ('10407', 'file', '10406', '/admin/page/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10408', 'file', '10406', '/admin/page/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10409', 'file', '10406', '/admin/page/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10410', 'file', '10406', '/admin/page/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10411', 'file', '10406', '/admin/page/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10412', 'file', '0', '/admin/auth', '权限管理', 'fa fa-group', '', '', '1', '1491655325', '1494259815', '0', 'normal'), ('10413', 'file', '10412', '/admin/auth/admin', '管理员管理', 'fa fa-users', '', '一个管理员可以有多个角色组,左侧的菜单根据管理员所拥有的权限进行生成', '1', '1491655325', '1491655325', '0', 'normal'), ('10414', 'file', '10413', '/admin/auth/admin/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10415', 'file', '10413', '/admin/auth/admin/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10416', 'file', '10413', '/admin/auth/admin/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10417', 'file', '10413', '/admin/auth/admin/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10418', 'file', '10413', '/admin/auth/admin/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10419', 'file', '10412', '/admin/auth/group', '角色组', 'fa fa-group', '', '角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别下级的角色组或管理员', '1', '1491655325', '1491655325', '0', 'normal'), ('10420', 'file', '10419', '/admin/auth/group/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10421', 'file', '10419', '/admin/auth/group/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10422', 'file', '10419', '/admin/auth/group/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10423', 'file', '10419', '/admin/auth/group/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10424', 'file', '10419', '/admin/auth/group/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10425', 'file', '10412', '/admin/auth/rule', '规则管理', 'fa fa-list', '', '规则通常对应一个控制器的方法,同时左侧的菜单栏数据也从规则中体现,通常建议通过控制台进行生成规则节点', '1', '1491655325', '1491655325', '0', 'normal'), ('10426', 'file', '10425', '/admin/auth/rule/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10427', 'file', '10425', '/admin/auth/rule/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10428', 'file', '10425', '/admin/auth/rule/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10429', 'file', '10425', '/admin/auth/rule/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10430', 'file', '10425', '/admin/auth/rule/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10431', 'file', '0', '/admin/general', '常规管理', 'fa fa-cog', '', '', '1', '1491655325', '1494259697', '0', 'normal'), ('10432', 'file', '10431', '/admin/general/attachment', '附件管理', 'fa fa-circle-o\r', '', '主要用于管理上传到又拍云的数据或上传至本服务的上传数据\r', '1', '1491655325', '1491655325', '0', 'normal'), ('10433', 'file', '10432', '/admin/general/attachment/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10434', 'file', '10432', '/admin/general/attachment/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10435', 'file', '10432', '/admin/general/attachment/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10436', 'file', '10432', '/admin/general/attachment/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10437', 'file', '10432', '/admin/general/attachment/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10438', 'file', '10431', '/admin/general/configvalue', '基本配置', 'fa fa-cog', '', '用于管理一些字典数据,通常以键值格式进行录入,保存的数据格式为JSON', '1', '1491655325', '1491655325', '0', 'normal'), ('10439', 'file', '10438', '/admin/general/configvalue/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10440', 'file', '10438', '/admin/general/configvalue/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10441', 'file', '10438', '/admin/general/configvalue/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10442', 'file', '10438', '/admin/general/configvalue/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10443', 'file', '10438', '/admin/general/configvalue/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10444', 'file', '10431', '/admin/general/crontab', '定时任务', 'fa fa-tasks', '', '类似于Linux的Crontab定时任务,可以按照设定的时间进行任务的执行,目前仅支持三种任务:请求URL、执行SQL、执行Shell', '1', '1491655325', '1491655325', '0', 'normal'), ('10445', 'file', '10444', '/admin/general/crontab/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10446', 'file', '10444', '/admin/general/crontab/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10447', 'file', '10444', '/admin/general/crontab/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10448', 'file', '10444', '/admin/general/crontab/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10449', 'file', '10444', '/admin/general/crontab/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10450', 'file', '10431', '/admin/general/database', '数据库管理', 'fa fa-database', '', '可在线进行一些简单的数据库表优化或修复,查看表结构和数据。也可以进行SQL语句的操作', '1', '1491655325', '1491655325', '0', 'normal'), ('10451', 'file', '10450', '/admin/general/database/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10452', 'file', '10450', '/admin/general/database/query', 'SQL查询', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10453', 'file', '10450', '/admin/general/database/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10454', 'file', '10450', '/admin/general/database/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10455', 'file', '10450', '/admin/general/database/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10456', 'file', '10450', '/admin/general/database/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10457', 'file', '10431', '/admin/general/profile', '个人配置', 'fa fa-user\r', '', '', '1', '1491655325', '1491655325', '0', 'normal'), ('10458', 'file', '10457', '/admin/general/profile/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10459', 'file', '10457', '/admin/general/profile/update', '更新个人信息', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10460', 'file', '10457', '/admin/general/profile/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10461', 'file', '10457', '/admin/general/profile/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10462', 'file', '10457', '/admin/general/profile/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10463', 'file', '10457', '/admin/general/profile/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10464', 'file', '0', '/admin/wechat', '微信管理', 'fa fa-wechat', '', '', '1', '1491655325', '1494259718', '0', 'normal'), ('10465', 'file', '10464', '/admin/wechat/autoreply', '微信自动回复管理', 'fa fa-circle-o\r', '', '', '1', '1491655325', '1491655325', '0', 'normal'), ('10466', 'file', '10465', '/admin/wechat/autoreply/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10467', 'file', '10465', '/admin/wechat/autoreply/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10468', 'file', '10465', '/admin/wechat/autoreply/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10469', 'file', '10465', '/admin/wechat/autoreply/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10470', 'file', '10465', '/admin/wechat/autoreply/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10471', 'file', '10464', '/admin/wechat/config', '配置管理', 'fa fa-list-alt', '', '', '1', '1491655325', '1491655325', '0', 'normal'), ('10472', 'file', '10471', '/admin/wechat/config/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10473', 'file', '10471', '/admin/wechat/config/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10474', 'file', '10471', '/admin/wechat/config/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10475', 'file', '10471', '/admin/wechat/config/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10476', 'file', '10471', '/admin/wechat/config/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10477', 'file', '10464', '/admin/wechat/menu', '菜单管理', 'fa fa-list-alt', '', '', '1', '1491655325', '1491655325', '0', 'normal'), ('10478', 'file', '10477', '/admin/wechat/menu/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10479', 'file', '10477', '/admin/wechat/menu/edit', '修改', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10480', 'file', '10477', '/admin/wechat/menu/sync', '同步', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10481', 'file', '10477', '/admin/wechat/menu/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10482', 'file', '10477', '/admin/wechat/menu/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10483', 'file', '10477', '/admin/wechat/menu/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10484', 'file', '10464', '/admin/wechat/response', '资源管理', 'fa fa-list-alt', '', '', '1', '1491655325', '1491655325', '0', 'normal'), ('10485', 'file', '10484', '/admin/wechat/response/select', '选择素材', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10486', 'file', '10484', '/admin/wechat/response/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10487', 'file', '10484', '/admin/wechat/response/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10488', 'file', '10484', '/admin/wechat/response/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10489', 'file', '10484', '/admin/wechat/response/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10490', 'file', '10484', '/admin/wechat/response/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10491', 'file', '0', '/admin/category', '分类管理', 'fa fa-list\r', '', '用于统一管理网站的所有分类,分类可进行无限级分类\r', '1', '1494259006', '1494259006', '0', 'normal'), ('10492', 'file', '10491', '/admin/category/index', '查看', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '0', 'normal'), ('10493', 'file', '10491', '/admin/category/add', '添加', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '0', 'normal'), ('10494', 'file', '10491', '/admin/category/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '0', 'normal'), ('10495', 'file', '10491', '/admin/category/del', '删除', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '0', 'normal'), ('10496', 'file', '10491', '/admin/category/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '0', 'normal'); +INSERT INTO `fa_auth_rule` VALUES ('10400', 'file', '0', '/admin/dashboard', '控制台', 'fa fa-dashboard', '', '用于展示当前系统中的统计数据、统计报表及重要实时数据\r\n', '1', '1491655325', '1492184975', '137', 'normal'), ('10401', 'file', '10400', '/admin/dashboard/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '136', 'normal'), ('10402', 'file', '10400', '/admin/dashboard/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '135', 'normal'), ('10403', 'file', '10400', '/admin/dashboard/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '134', 'normal'), ('10404', 'file', '10400', '/admin/dashboard/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '133', 'normal'), ('10405', 'file', '10400', '/admin/dashboard/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '132', 'normal'), ('10406', 'file', '0', '/admin/page', '单页管理', 'fa fa-tags', '', '用于管理普通的单页面,通常用于关于我们、联系我们、商务合作等单一页面\r\n', '1', '1491655325', '1494259768', '73', 'normal'), ('10407', 'file', '10406', '/admin/page/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '130', 'normal'), ('10408', 'file', '10406', '/admin/page/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '129', 'normal'), ('10409', 'file', '10406', '/admin/page/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '128', 'normal'), ('10410', 'file', '10406', '/admin/page/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '127', 'normal'), ('10411', 'file', '10406', '/admin/page/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '126', 'normal'), ('10412', 'file', '0', '/admin/auth', '权限管理', 'fa fa-group', '', '', '1', '1491655325', '1494259815', '46', 'normal'), ('10413', 'file', '10412', '/admin/auth/admin', '管理员管理', 'fa fa-users', '', '一个管理员可以有多个角色组,左侧的菜单根据管理员所拥有的权限进行生成', '1', '1491655325', '1491655325', '124', 'normal'), ('10414', 'file', '10413', '/admin/auth/admin/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '123', 'normal'), ('10415', 'file', '10413', '/admin/auth/admin/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '122', 'normal'), ('10416', 'file', '10413', '/admin/auth/admin/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '121', 'normal'), ('10417', 'file', '10413', '/admin/auth/admin/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '120', 'normal'), ('10418', 'file', '10413', '/admin/auth/admin/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '119', 'normal'), ('10419', 'file', '10412', '/admin/auth/group', '角色组', 'fa fa-group', '', '角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别下级的角色组或管理员', '1', '1491655325', '1491655325', '118', 'normal'), ('10420', 'file', '10419', '/admin/auth/group/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '117', 'normal'), ('10421', 'file', '10419', '/admin/auth/group/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '116', 'normal'), ('10422', 'file', '10419', '/admin/auth/group/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '115', 'normal'), ('10423', 'file', '10419', '/admin/auth/group/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '114', 'normal'), ('10424', 'file', '10419', '/admin/auth/group/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '113', 'normal'), ('10425', 'file', '10412', '/admin/auth/rule', '规则管理', 'fa fa-list', '', '规则通常对应一个控制器的方法,同时左侧的菜单栏数据也从规则中体现,通常建议通过控制台进行生成规则节点', '1', '1491655325', '1491655325', '112', 'normal'), ('10426', 'file', '10425', '/admin/auth/rule/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '111', 'normal'), ('10427', 'file', '10425', '/admin/auth/rule/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '110', 'normal'), ('10428', 'file', '10425', '/admin/auth/rule/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '109', 'normal'), ('10429', 'file', '10425', '/admin/auth/rule/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '108', 'normal'), ('10430', 'file', '10425', '/admin/auth/rule/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '107', 'normal'), ('10431', 'file', '0', '/admin/general', '常规管理', 'fa fa-cog', '', '', '1', '1491655325', '1494259697', '131', 'normal'), ('10432', 'file', '10431', '/admin/general/attachment', '附件管理', 'fa fa-circle-o\r', '', '主要用于管理上传到又拍云的数据或上传至本服务的上传数据\r', '1', '1491655325', '1491655325', '80', 'normal'), ('10433', 'file', '10432', '/admin/general/attachment/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '104', 'normal'), ('10434', 'file', '10432', '/admin/general/attachment/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '103', 'normal'), ('10435', 'file', '10432', '/admin/general/attachment/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '102', 'normal'), ('10436', 'file', '10432', '/admin/general/attachment/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '101', 'normal'), ('10437', 'file', '10432', '/admin/general/attachment/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '100', 'normal'), ('10438', 'file', '10431', '/admin/general/configvalue', '基本配置', 'fa fa-cog', '', '用于管理一些字典数据,通常以键值格式进行录入,保存的数据格式为JSON', '1', '1491655325', '1491655325', '105', 'normal'), ('10439', 'file', '10438', '/admin/general/configvalue/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '98', 'normal'), ('10440', 'file', '10438', '/admin/general/configvalue/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '97', 'normal'), ('10441', 'file', '10438', '/admin/general/configvalue/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '96', 'normal'), ('10442', 'file', '10438', '/admin/general/configvalue/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '95', 'normal'), ('10443', 'file', '10438', '/admin/general/configvalue/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '94', 'normal'), ('10444', 'file', '10431', '/admin/general/crontab', '定时任务', 'fa fa-tasks', '', '类似于Linux的Crontab定时任务,可以按照设定的时间进行任务的执行,目前仅支持三种任务:请求URL、执行SQL、执行Shell', '1', '1491655325', '1491655325', '99', 'normal'), ('10445', 'file', '10444', '/admin/general/crontab/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '92', 'normal'), ('10446', 'file', '10444', '/admin/general/crontab/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '91', 'normal'), ('10447', 'file', '10444', '/admin/general/crontab/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '90', 'normal'), ('10448', 'file', '10444', '/admin/general/crontab/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '89', 'normal'), ('10449', 'file', '10444', '/admin/general/crontab/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '88', 'normal'), ('10450', 'file', '10431', '/admin/general/database', '数据库管理', 'fa fa-database', '', '可在线进行一些简单的数据库表优化或修复,查看表结构和数据。也可以进行SQL语句的操作', '1', '1491655325', '1491655325', '93', 'normal'), ('10451', 'file', '10450', '/admin/general/database/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '86', 'normal'), ('10452', 'file', '10450', '/admin/general/database/query', 'SQL查询', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '85', 'normal'), ('10453', 'file', '10450', '/admin/general/database/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '84', 'normal'), ('10454', 'file', '10450', '/admin/general/database/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '83', 'normal'), ('10455', 'file', '10450', '/admin/general/database/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '82', 'normal'), ('10456', 'file', '10450', '/admin/general/database/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '81', 'normal'), ('10457', 'file', '10431', '/admin/general/profile', '个人配置', 'fa fa-user\r', '', '', '1', '1491655325', '1491655325', '87', 'normal'), ('10458', 'file', '10457', '/admin/general/profile/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '79', 'normal'), ('10459', 'file', '10457', '/admin/general/profile/update', '更新个人信息', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '78', 'normal'), ('10460', 'file', '10457', '/admin/general/profile/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '77', 'normal'), ('10461', 'file', '10457', '/admin/general/profile/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '76', 'normal'), ('10462', 'file', '10457', '/admin/general/profile/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '75', 'normal'), ('10463', 'file', '10457', '/admin/general/profile/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '74', 'normal'), ('10464', 'file', '0', '/admin/wechat', '微信管理', 'fa fa-wechat', '', '', '1', '1491655325', '1494259718', '40', 'normal'), ('10465', 'file', '10464', '/admin/wechat/autoreply', '微信自动回复管理', 'fa fa-circle-o\r', '', '', '1', '1491655325', '1491655325', '72', 'normal'), ('10466', 'file', '10465', '/admin/wechat/autoreply/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '71', 'normal'), ('10467', 'file', '10465', '/admin/wechat/autoreply/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '70', 'normal'), ('10468', 'file', '10465', '/admin/wechat/autoreply/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '69', 'normal'), ('10469', 'file', '10465', '/admin/wechat/autoreply/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '68', 'normal'), ('10470', 'file', '10465', '/admin/wechat/autoreply/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '67', 'normal'), ('10471', 'file', '10464', '/admin/wechat/config', '配置管理', 'fa fa-list-alt', '', '', '1', '1491655325', '1491655325', '66', 'normal'), ('10472', 'file', '10471', '/admin/wechat/config/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '65', 'normal'), ('10473', 'file', '10471', '/admin/wechat/config/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '64', 'normal'), ('10474', 'file', '10471', '/admin/wechat/config/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '63', 'normal'), ('10475', 'file', '10471', '/admin/wechat/config/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '62', 'normal'), ('10476', 'file', '10471', '/admin/wechat/config/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '61', 'normal'), ('10477', 'file', '10464', '/admin/wechat/menu', '菜单管理', 'fa fa-list-alt', '', '', '1', '1491655325', '1491655325', '60', 'normal'), ('10478', 'file', '10477', '/admin/wechat/menu/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '59', 'normal'), ('10479', 'file', '10477', '/admin/wechat/menu/edit', '修改', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '58', 'normal'), ('10480', 'file', '10477', '/admin/wechat/menu/sync', '同步', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '57', 'normal'), ('10481', 'file', '10477', '/admin/wechat/menu/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '56', 'normal'), ('10482', 'file', '10477', '/admin/wechat/menu/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '55', 'normal'), ('10483', 'file', '10477', '/admin/wechat/menu/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '54', 'normal'), ('10484', 'file', '10464', '/admin/wechat/response', '资源管理', 'fa fa-list-alt', '', '', '1', '1491655325', '1491655325', '53', 'normal'), ('10485', 'file', '10484', '/admin/wechat/response/select', '选择素材', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '52', 'normal'), ('10486', 'file', '10484', '/admin/wechat/response/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '51', 'normal'), ('10487', 'file', '10484', '/admin/wechat/response/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '50', 'normal'), ('10488', 'file', '10484', '/admin/wechat/response/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '49', 'normal'), ('10489', 'file', '10484', '/admin/wechat/response/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '48', 'normal'), ('10490', 'file', '10484', '/admin/wechat/response/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '47', 'normal'), ('10491', 'file', '0', '/admin/category', '分类管理', 'fa fa-list\r', '', '用于统一管理网站的所有分类,分类可进行无限级分类\r', '1', '1494259006', '1494259006', '106', 'normal'), ('10492', 'file', '10491', '/admin/category/index', '查看', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '45', 'normal'), ('10493', 'file', '10491', '/admin/category/add', '添加', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '44', 'normal'), ('10494', 'file', '10491', '/admin/category/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '43', 'normal'), ('10495', 'file', '10491', '/admin/category/del', '删除', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '42', 'normal'), ('10496', 'file', '10491', '/admin/category/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '41', 'normal'), ('10497', 'file', '0', '/admin/example', '示例管理', 'fa fa-magic', '', '', '1', '1495273225', '1495273469', '125', 'normal'), ('10498', 'file', '10497', '/admin/example/bootstraptable', '表格完整示例', 'fa fa-table', '', '在使用Bootstrap-table中的常用方式,更多使用方式可查看:http://bootstrap-table.wenzhixin.net.cn/zh-cn/', '1', '1495273225', '1495273225', '39', 'normal'), ('10499', 'file', '10498', '/admin/example/bootstraptable/index', '查看', 'fa fa-circle-o', '', '', '0', '1495273225', '1495273225', '38', 'normal'), ('10500', 'file', '10498', '/admin/example/bootstraptable/detail', '详情', 'fa fa-circle-o', '', '', '0', '1495273225', '1495273225', '37', 'normal'), ('10501', 'file', '10498', '/admin/example/bootstraptable/add', '添加', 'fa fa-circle-o', '', '', '0', '1495273225', '1495273225', '36', 'normal'), ('10502', 'file', '10498', '/admin/example/bootstraptable/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1495273225', '1495273225', '35', 'normal'), ('10503', 'file', '10498', '/admin/example/bootstraptable/del', '删除', 'fa fa-circle-o', '', '', '0', '1495273225', '1495273225', '34', 'normal'), ('10504', 'file', '10498', '/admin/example/bootstraptable/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1495273225', '1495273225', '33', 'normal'), ('10505', 'file', '10497', '/admin/example/colorbadge', '彩色角标', 'fa fa-table', '', '在JS端控制角标的显示与隐藏,请注意左侧菜单栏角标的数值变化', '1', '1495273229', '1495273229', '32', 'normal'), ('10506', 'file', '10505', '/admin/example/colorbadge/index', '查看', 'fa fa-circle-o', '', '', '0', '1495273229', '1495273229', '31', 'normal'), ('10507', 'file', '10505', '/admin/example/colorbadge/add', '添加', 'fa fa-circle-o', '', '', '0', '1495273229', '1495273229', '30', 'normal'), ('10508', 'file', '10505', '/admin/example/colorbadge/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1495273229', '1495273229', '29', 'normal'), ('10509', 'file', '10505', '/admin/example/colorbadge/del', '删除', 'fa fa-circle-o', '', '', '0', '1495273229', '1495273229', '28', 'normal'), ('10510', 'file', '10505', '/admin/example/colorbadge/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1495273229', '1495273229', '27', 'normal'), ('10511', 'file', '10497', '/admin/example/controllerjump', '控制器间跳转', 'fa fa-table', '', 'FastAdmin支持在控制器间跳转,点击后将切换到另外一个TAB中,无需刷新当前页面', '1', '1495273234', '1495273234', '26', 'normal'), ('10512', 'file', '10511', '/admin/example/controllerjump/index', '查看', 'fa fa-circle-o', '', '', '0', '1495273234', '1495273234', '25', 'normal'), ('10513', 'file', '10511', '/admin/example/controllerjump/add', '添加', 'fa fa-circle-o', '', '', '0', '1495273234', '1495273234', '24', 'normal'), ('10514', 'file', '10511', '/admin/example/controllerjump/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1495273234', '1495273234', '23', 'normal'), ('10515', 'file', '10511', '/admin/example/controllerjump/del', '删除', 'fa fa-circle-o', '', '', '0', '1495273234', '1495273234', '22', 'normal'), ('10516', 'file', '10511', '/admin/example/controllerjump/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1495273234', '1495273234', '21', 'normal'), ('10517', 'file', '10497', '/admin/example/cxselect', '多级联动', 'fa fa-table', '', 'FastAdmin使用了jQuery-cxselect实现多级联动,更多文档请参考https://github.com/karsonzhang/cxSelect
', '1', '1495273239', '1495273239', '20', 'normal'), ('10518', 'file', '10517', '/admin/example/cxselect/index', 'index', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '19', 'normal'), ('10519', 'file', '10517', '/admin/example/cxselect/city', 'city', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '18', 'normal'), ('10520', 'file', '10517', '/admin/example/cxselect/category', 'category', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '17', 'normal'), ('10521', 'file', '10517', '/admin/example/cxselect/add', '添加', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '16', 'normal'), ('10522', 'file', '10517', '/admin/example/cxselect/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '15', 'normal'), ('10523', 'file', '10517', '/admin/example/cxselect/del', '删除', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '14', 'normal'), ('10524', 'file', '10517', '/admin/example/cxselect/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '13', 'normal'), ('10525', 'file', '10497', '/admin/example/multitable', '多表格示例', 'fa fa-table', '', '当一个页面上存在多个Bootstrap-table时该如何控制按钮和表格', '1', '1495273245', '1495273245', '12', 'normal'), ('10526', 'file', '10525', '/admin/example/multitable/index', '查看', 'fa fa-circle-o', '', '', '0', '1495273245', '1495273245', '11', 'normal'), ('10527', 'file', '10525', '/admin/example/multitable/add', '添加', 'fa fa-circle-o', '', '', '0', '1495273245', '1495273245', '10', 'normal'), ('10528', 'file', '10525', '/admin/example/multitable/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1495273245', '1495273245', '9', 'normal'), ('10529', 'file', '10525', '/admin/example/multitable/del', '删除', 'fa fa-circle-o', '', '', '0', '1495273245', '1495273245', '8', 'normal'), ('10530', 'file', '10525', '/admin/example/multitable/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1495273245', '1495273245', '7', 'normal'), ('10531', 'file', '10497', '/admin/example/relationmodel', '多模型关联', 'fa fa-table', '', '当使用到关联模型时需要重载index方法', '1', '1495273250', '1495273250', '6', 'normal'), ('10532', 'file', '10531', '/admin/example/relationmodel/index', '查看', 'fa fa-circle-o', '', '', '0', '1495273250', '1495273250', '5', 'normal'), ('10533', 'file', '10531', '/admin/example/relationmodel/add', '添加', 'fa fa-circle-o', '', '', '0', '1495273250', '1495273250', '4', 'normal'), ('10534', 'file', '10531', '/admin/example/relationmodel/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1495273250', '1495273250', '3', 'normal'), ('10535', 'file', '10531', '/admin/example/relationmodel/del', '删除', 'fa fa-circle-o', '', '', '0', '1495273250', '1495273250', '2', 'normal'), ('10536', 'file', '10531', '/admin/example/relationmodel/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1495273250', '1495273250', '1', 'normal'); COMMIT; -- ---------------------------- @@ -180,7 +189,7 @@ CREATE TABLE `fa_category` ( `type` varchar(30) NOT NULL DEFAULT '' COMMENT '栏目类型', `name` varchar(30) NOT NULL DEFAULT '', `nickname` varchar(50) NOT NULL DEFAULT '', - `flag` set('h','i','r') NOT NULL DEFAULT '', + `flag` set('hot','index','recommend') NOT NULL DEFAULT '', `image` varchar(100) NOT NULL DEFAULT '' COMMENT '图片', `keywords` varchar(255) NOT NULL DEFAULT '' COMMENT '关键字', `description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述', @@ -192,7 +201,14 @@ CREATE TABLE `fa_category` ( PRIMARY KEY (`id`), KEY `weigh` (`weigh`,`id`), KEY `pid` (`pid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='分类表'; +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='分类表'; + +-- ---------------------------- +-- Records of `fa_category` +-- ---------------------------- +BEGIN; +INSERT INTO `fa_category` VALUES ('1', '0', 'page', '官方新闻', 'news', 'recommend', '', '', '', 'news', '1495262190', '1495262190', '0', 'normal'), ('2', '0', 'page', '移动应用', 'mobileapp', 'hot', '', '', '', 'mobileapp', '1495262244', '1495262244', '0', 'normal'), ('3', '2', 'page', '微信公众号', 'wechatpublic', 'index', '', '', '', 'wechatpublic', '1495262288', '1495262288', '0', 'normal'), ('4', '2', 'page', 'Android开发', 'android', 'recommend', '', '', '', 'android', '1495262317', '1495262317', '0', 'normal'), ('5', '0', 'default', '软件产品', 'software', 'recommend', '', '', '', 'software', '1495262336', '1495262336', '0', 'normal'), ('6', '5', 'page', '网站建站', 'website', 'recommend', '', '', '', 'website', '1495262357', '1495262357', '0', 'normal'), ('7', '5', 'page', '企业管理软件', 'company', 'index', '', '', '', 'company', '1495262391', '1495262391', '0', 'normal'), ('8', '6', 'page', 'PC端', 'website-pc', 'recommend', '', '', '', 'website-pc', '1495262424', '1495262424', '0', 'normal'), ('9', '6', 'page', '移动端', 'website-mobile', 'recommend', '', '', '', 'website-mobile', '1495262456', '1495262456', '0', 'normal'), ('10', '7', 'page', 'CRM系统 ', 'company-crm', 'recommend', '', '', '', 'company-crm', '1495262487', '1495262487', '0', 'normal'), ('11', '7', 'page', 'SASS平台软件', 'company-sass', 'recommend', '', '', '', 'company-sass', '1495262515', '1495262515', '0', 'normal'); +COMMIT; -- ---------------------------- -- Table structure for `fa_configvalue` @@ -237,7 +253,7 @@ CREATE TABLE `fa_crontab` ( `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重', `status` enum('completed','expired','hidden','normal') NOT NULL DEFAULT 'normal' COMMENT '状态', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='定时任务表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='定时任务表'; -- ---------------------------- -- Table structure for `fa_page` @@ -248,7 +264,7 @@ CREATE TABLE `fa_page` ( `category_id` int(10) NOT NULL DEFAULT '0' COMMENT '分类ID', `title` varchar(50) NOT NULL DEFAULT '' COMMENT '标题', `keywords` varchar(255) NOT NULL DEFAULT '' COMMENT '关键字', - `flag` set('h','i','s') NOT NULL DEFAULT '' COMMENT '标志', + `flag` set('hot','index','recommend') NOT NULL DEFAULT '' COMMENT '标志', `image` varchar(255) NOT NULL DEFAULT '' COMMENT '头像', `content` text NOT NULL COMMENT '内容', `icon` varchar(50) NOT NULL DEFAULT '' COMMENT '图标', @@ -259,7 +275,7 @@ CREATE TABLE `fa_page` ( `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重', `status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='单页表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='单页表'; -- ---------------------------- -- Table structure for `fa_test` @@ -293,7 +309,7 @@ CREATE TABLE `fa_test` ( `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重', `status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='测试表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='测试表'; -- ---------------------------- -- Table structure for `fa_user` @@ -343,7 +359,7 @@ CREATE TABLE `fa_user_signin` ( `createtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', PRIMARY KEY (`id`), KEY `user_id` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='会员签到表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='会员签到表'; -- ---------------------------- -- Table structure for `fa_user_third` @@ -432,7 +448,7 @@ CREATE TABLE `fa_wechat_context` ( `updatetime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`id`), KEY `openid` (`openid`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='微信上下文表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='微信上下文表'; -- ---------------------------- -- Table structure for `fa_wechat_response` @@ -450,7 +466,7 @@ CREATE TABLE `fa_wechat_response` ( `status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态', PRIMARY KEY (`id`), UNIQUE KEY `event` (`eventkey`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='微信资源表'; +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='微信资源表'; -- ---------------------------- -- Records of `fa_wechat_response` diff --git a/application/admin/command/Menu.php b/application/admin/command/Menu.php index 2ff9d73c..a4319430 100644 --- a/application/admin/command/Menu.php +++ b/application/admin/command/Menu.php @@ -31,7 +31,7 @@ class Menu extends Command $this->model = new AuthRule(); $adminPath = dirname(__DIR__) . DS; //控制器名 - $controller = $input->getOption('controller') ? : ''; + $controller = $input->getOption('controller') ?: ''; if (!$controller) { throw new Exception("please input controller name"); @@ -129,21 +129,19 @@ class Menu extends Command $controllerArr[$key] = ucfirst($controllerArr[$key]); $classSuffix = Config::get('controller_suffix') ? ucfirst(Config::get('url_controller_layer')) : ''; $className = "\\app\\admin\\controller\\" . implode("\\", $controllerArr) . $classSuffix; - if (version_compare(PHP_VERSION, '7.0.0', '<')) - { - $pathArr = $controllerArr; - array_unshift($pathArr, '', 'application', 'admin', 'controller'); - $classFile = ROOT_PATH . implode(DS, $pathArr) . $classSuffix . ".php"; - $classContent = file_get_contents($classFile); - $uniqueName = uniqid("FastAdmin") . $classSuffix; - $classContent = str_replace("class " . $controllerArr[$key] . $classSuffix . " ", 'class ' . $uniqueName . ' ', $classContent); - $classContent = preg_replace("/namespace\s(.*);/", 'namespace ' . __NAMESPACE__ . ";", $classContent); - //临时的类文件 - $tempClassFile = __DIR__ . DS . $uniqueName . ".php"; - file_put_contents($tempClassFile, $classContent); - $className = "\\app\\admin\\command\\" . $uniqueName; - } + $pathArr = $controllerArr; + array_unshift($pathArr, '', 'application', 'admin', 'controller'); + $classFile = ROOT_PATH . implode(DS, $pathArr) . $classSuffix . ".php"; + $classContent = file_get_contents($classFile); + $uniqueName = uniqid("FastAdmin") . $classSuffix; + $classContent = str_replace("class " . $controllerArr[$key] . $classSuffix . " ", 'class ' . $uniqueName . ' ', $classContent); + $classContent = preg_replace("/namespace\s(.*);/", 'namespace ' . __NAMESPACE__ . ";", $classContent); + + //临时的类文件 + $tempClassFile = __DIR__ . DS . $uniqueName . ".php"; + file_put_contents($tempClassFile, $classContent); + $className = "\\app\\admin\\command\\" . $uniqueName; //反射机制调用类的注释和方法名 $reflector = new ReflectionClass($className); @@ -181,16 +179,20 @@ class Menu extends Command } //过滤掉其它字符 $controllerTitle = trim(preg_replace(array('/^\/\*\*(.*)[\n\r\t]/u', '/[\s]+\*\//u', '/\*\s@(.*)/u', '/[\s|\*]+/u'), '', $classComment)); + + //导入中文语言包 + \think\Lang::load(dirname(__DIR__) . DS . 'lang/zh-cn.php'); + //先定入菜单的数据 $pid = 0; $name = "/admin"; foreach (explode('/', $controller) as $k => $v) { $name .= '/' . strtolower($v); - $title = (!isset($controllerArr[$k + 1]) ? $controllerTitle : ucfirst($v)); + $title = (!isset($controllerArr[$k + 1]) ? $controllerTitle : ''); $icon = (!isset($controllerArr[$k + 1]) ? $controllerIcon : 'fa fa-list'); $remark = (!isset($controllerArr[$k + 1]) ? $controllerRemark : ''); - $title = $title ? $title : ucfirst($v); + $title = $title ? $title : __(ucfirst($v) . ' manager'); $rulemodel = $this->model->get(['name' => $name]); if (!$rulemodel) { diff --git a/application/admin/command/Min/r.js b/application/admin/command/Min/r.js old mode 100644 new mode 100755 diff --git a/application/admin/command/Min/stubs/js.stub b/application/admin/command/Min/stubs/js.stub index 7f573102..67a49a4e 100644 --- a/application/admin/command/Min/stubs/js.stub +++ b/application/admin/command/Min/stubs/js.stub @@ -2,7 +2,7 @@ {%config%} , optimizeCss: "standard", - optimize: "none", + optimize: "none", //可使用uglify|closure|none removeCombined: false, baseUrl: "{%jsBasePath%}", //JS文件所在的基础目录 name: "{%jsBaseName%}", //来源文件,不包含后缀 diff --git a/application/admin/common.php b/application/admin/common.php index 7c11ac1d..a19b4220 100644 --- a/application/admin/common.php +++ b/application/admin/common.php @@ -140,12 +140,10 @@ function build_heading($title = NULL, $content = NULL) { if (is_null($title) && is_null($content)) { + $path = request()->pathinfo(); + $path = $path[0] == '/' ? $path : '/' . $path; // 根据当前的URI自动匹配父节点的标题和备注 - $path = Auth::instance()->getRequestUri(); - $data = Db::name('auth_rule')->where('id', 'IN', function($query) use($path) - { - $query->name('auth_rule')->where('name', $path)->field('pid'); - })->find(); + $data = Db::name('auth_rule')->where('name', $path)->field('title,remark')->find(); if ($data) { $title = $data['title']; diff --git a/application/admin/controller/Ajax.php b/application/admin/controller/Ajax.php index b92838ad..9e90b543 100644 --- a/application/admin/controller/Ajax.php +++ b/application/admin/controller/Ajax.php @@ -3,7 +3,6 @@ namespace app\admin\controller; use app\common\controller\Backend; -use fast\Http; use fast\Random; use fast\Tree; use RecursiveDirectoryIterator; @@ -20,7 +19,7 @@ use think\Lang; class Ajax extends Backend { - protected $noNeedLogin = ['dailybg', 'lang']; + protected $noNeedLogin = ['lang']; protected $noNeedRight = ['*']; protected $layout = ''; @@ -29,8 +28,8 @@ class Ajax extends Backend */ public function typeahead() { - $search = $this->_request->getRequest("search"); - $field = $this->_request->getRequest("field"); + $search = $this->request->get("search"); + $field = $this->request->get("field"); $field = str_replace(['row[', ']'], '', $field); if (substr($field, -3) !== '_id' && substr($field, -4) !== '_ids') { @@ -50,11 +49,12 @@ class Ajax extends Backend break; } - $searchlist = Db::table($field) - ->orWhere($searchfield, 'like', "%{$search}%") - ->orWhere('id', 'like', "%{$search}%") + $searchlist = Db::name($field) + ->whereOr($searchfield, 'like', "%{$search}%") + ->whereOr('id', 'like', "%{$search}%") ->limit(10) - ->select("id,{$searchfield} AS name"); + ->field("id,{$searchfield} AS name") + ->select(); foreach ($searchlist as $k => &$v) { @@ -80,54 +80,6 @@ class Ajax extends Backend return $result; } - /** - * 每日一图 - */ - public function dailybg() - { - //采用Infinty的图片 - $this->code = 1; - $this->data = [ - 'url' => 'http://img.infinitynewtab.com/wallpaper/' . (date("Ymd") % 4000) . '.jpg' - ]; - return; - //采用Bing每日一图 - $ret = Http::sendRequest("http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1", [], 'GET'); - if ($ret['ret']) - { - $json = json_decode($ret['msg'], TRUE); - if ($json && isset($json['images'][0])) - { - $url = $json['images'][0]['url']; - $startdate = $json['images'][0]['startdate']; - $enddate = $json['images'][0]['enddate']; - $copyright = $json['images'][0]['copyright']; - $url = substr($url, 0, 4) != 'http' ? 'http://cn.bing.com' . $url : $url; - $title = ''; - $intro = ''; - $ret = Http::sendRequest("http://cn.bing.com/cnhp/coverstory/", [], 'GET'); - if ($ret['ret']) - { - $info = json_decode($ret['msg'], TRUE); - if (isset($info['title'])) - { - $title = $info['title']; - $intro = $info['para1']; - } - } - $this->code = 1; - $this->data = [ - 'title' => $title, - 'intro' => $intro, - 'url' => $url, - 'startdate' => $startdate, - 'enddate' => $enddate, - 'copyright' => $copyright, - ]; - } - } - } - /** * 读取角色权限树 */ @@ -374,4 +326,51 @@ class Ajax extends Backend $this->code = 1; } + /** + * 读取分类数据 + */ + public function category() + { + $type = $this->request->get('type'); + $pid = $this->request->get('pid'); + $where = ['status' => 'normal']; + if ($type) + { + $where['type'] = $type; + } + if ($pid) + { + $where['pid'] = $pid; + } + + $categorylist = Db::name('category')->where($where)->field('id as value,name')->order('weigh desc,id desc')->select(); + $this->code = 1; + $this->data = $categorylist; + return; + } + + /** + * 读取省市区数据 + */ + public function area() + { + $province = $this->request->get('province'); + $city = $this->request->get('city'); + $where = ['pid' => 0, 'level' => 1]; + if ($province) + { + $where['pid'] = $province; + $where['level'] = 2; + } + if ($city) + { + $where['pid'] = $city; + $where['level'] = 3; + } + $provincelist = Db::name('area')->where($where)->field('id as value,name')->select(); + $this->code = 1; + $this->data = $provincelist; + return; + } + } diff --git a/application/admin/controller/auth/Admin.php b/application/admin/controller/auth/Admin.php index f6638bf5..c93c70a3 100644 --- a/application/admin/controller/auth/Admin.php +++ b/application/admin/controller/auth/Admin.php @@ -2,7 +2,6 @@ namespace app\admin\controller\auth; -use app\admin\model\AdminLog; use app\common\controller\Backend; use fast\Random; use fast\Tree; @@ -46,6 +45,37 @@ class Admin extends Backend $this->view->assign('groupdata', $groupdata); } + /** + * 查看 + */ + public function index() + { + if ($this->request->isAjax()) + { + $childrenAdminIds = model('AuthGroupAccess') + ->field('uid') + ->where('group_id', 'in', $this->childrenIds) + ->column('uid'); + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + $total = $this->model + ->where($where) + ->where('id', 'in', $childrenAdminIds) + ->order($sort, $order) + ->count(); + + $list = $this->model + ->where($where) + ->where('id', 'in', $childrenAdminIds) + ->order($sort, $order) + ->limit($offset, $limit) + ->select(); + $result = array("total" => $total, "rows" => $list); + + return json($result); + } + return $this->view->fetch(); + } + /** * 添加 */ @@ -61,7 +91,6 @@ class Admin extends Backend $params['password'] = md5(md5($params['password']) . $params['salt']); $admin = $this->model->create($params); - AdminLog::record(__('Add'), $this->model->getLastInsID()); $group = $this->request->post("group/a"); //过滤不允许的组别,避免越权 @@ -99,8 +128,11 @@ class Admin extends Backend $params['salt'] = Random::alnum(); $params['password'] = md5(md5($params['password']) . $params['salt']); } + else + { + unset($params['password'], $params['salt']); + } $row->save($params); - AdminLog::record(__('Edit'), $ids); // 先移除所有权限 model('AuthGroupAccess')->where('uid', $row->id)->delete(); @@ -142,8 +174,7 @@ class Admin extends Backend { // 避免越权删除管理员 $childrenGroupIds = $this->childrenIds; - $adminList = $this->model->where('id', 'in', $ids)->where('id', 'in', function($query) use($childrenGroupIds) - { + $adminList = $this->model->where('id', 'in', $ids)->where('id', 'in', function($query) use($childrenGroupIds) { $query->name('auth_group_access')->where('group_id', 'in', $childrenGroupIds)->field('uid'); })->select(); if ($adminList) @@ -156,7 +187,6 @@ class Admin extends Backend $deleteIds = array_diff($deleteIds, [$this->auth->id]); if ($deleteIds) { - AdminLog::record(__('Del'), $deleteIds); $this->model->destroy($deleteIds); model('AuthGroupAccess')->where('uid', 'in', $deleteIds)->delete(); $this->code = 1; diff --git a/application/admin/controller/auth/Group.php b/application/admin/controller/auth/Group.php index 488bf73e..5e5cb999 100644 --- a/application/admin/controller/auth/Group.php +++ b/application/admin/controller/auth/Group.php @@ -2,7 +2,6 @@ namespace app\admin\controller\auth; -use app\admin\model\AdminLog; use app\common\controller\Backend; use fast\Tree; @@ -106,7 +105,6 @@ class Group extends Backend if ($params) { $this->model->create($params); - AdminLog::record(__('Add'), $this->model->getLastInsID()); $this->code = 1; } @@ -154,7 +152,6 @@ class Group extends Backend if ($params) { $row->save($params); - AdminLog::record(__('Edit'), $ids); $this->code = 1; } @@ -209,7 +206,6 @@ class Group extends Backend $count = $this->model->where('id', 'in', $ids)->delete(); if ($count) { - AdminLog::record(__('Del'), $ids); $this->code = 1; } } diff --git a/application/admin/controller/auth/Rule.php b/application/admin/controller/auth/Rule.php index ed559005..b8cae2a3 100644 --- a/application/admin/controller/auth/Rule.php +++ b/application/admin/controller/auth/Rule.php @@ -2,7 +2,6 @@ namespace app\admin\controller\auth; -use app\admin\model\AdminLog; use app\common\controller\Backend; use fast\Tree; use think\Cache; @@ -70,7 +69,6 @@ class Rule extends Backend return; } $this->model->create($params); - AdminLog::record(__('Add'), $this->model->getLastInsID()); Cache::rm('__menu__'); $this->code = 1; } @@ -100,7 +98,6 @@ class Rule extends Backend return; } $row->save($params); - AdminLog::record(__('Edit'), $ids); Cache::rm('__menu__'); $this->code = 1; } @@ -128,7 +125,6 @@ class Rule extends Backend $count = $this->model->where('id', 'in', $delIds)->delete(); if ($count) { - AdminLog::record(__('Del'), $ids); Cache::rm('__menu__'); $this->code = 1; } diff --git a/application/admin/controller/example/Bootstraptable.php b/application/admin/controller/example/Bootstraptable.php new file mode 100644 index 00000000..24502db0 --- /dev/null +++ b/application/admin/controller/example/Bootstraptable.php @@ -0,0 +1,60 @@ +model = model('AdminLog'); + } + + /** + * 查看 + */ + public function index() + { + if ($this->request->isAjax()) + { + list($where, $sort, $order, $offset, $limit) = $this->buildparams(NULL); + $total = $this->model + ->where($where) + ->order($sort, $order) + ->count(); + $list = $this->model + ->where($where) + ->order($sort, $order) + ->limit($offset, $limit) + ->select(); + $result = array("total" => $total, "rows" => $list); + + return json($result); + } + return $this->view->fetch(); + } + + /** + * 详情 + */ + public function detail($ids) + { + $row = $this->model->get(['id' => $ids]); + if (!$row) + $this->error(__('No Results were found')); + $this->view->assign("row", $row->toArray()); + return $this->view->fetch(); + } + +} diff --git a/application/admin/controller/example/Colorbadge.php b/application/admin/controller/example/Colorbadge.php new file mode 100644 index 00000000..4d0bc213 --- /dev/null +++ b/application/admin/controller/example/Colorbadge.php @@ -0,0 +1,24 @@ +model = model('AdminLog'); + } + +} diff --git a/application/admin/controller/example/Controllerjump.php b/application/admin/controller/example/Controllerjump.php new file mode 100644 index 00000000..2bd1540e --- /dev/null +++ b/application/admin/controller/example/Controllerjump.php @@ -0,0 +1,24 @@ +model = model('AdminLog'); + } + +} diff --git a/application/admin/controller/example/Cxselect.php b/application/admin/controller/example/Cxselect.php new file mode 100644 index 00000000..391c0977 --- /dev/null +++ b/application/admin/controller/example/Cxselect.php @@ -0,0 +1,23 @@ +view->fetch(); + } + +} diff --git a/application/admin/controller/example/Relationmodel.php b/application/admin/controller/example/Relationmodel.php new file mode 100644 index 00000000..a173352a --- /dev/null +++ b/application/admin/controller/example/Relationmodel.php @@ -0,0 +1,50 @@ +model = model('AdminLog'); + } + + /** + * 查看 + */ + public function index() + { + if ($this->request->isAjax()) + { + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + $total = $this->model + ->with("Admin") + ->where($where) + ->order($sort, $order) + ->count(); + $list = $this->model + ->with("Admin") + ->where($where) + ->order($sort, $order) + ->limit($offset, $limit) + ->select(); + $result = array("total" => $total, "rows" => $list); + + return json($result); + } + return $this->view->fetch(); + } + +} diff --git a/application/admin/controller/general/Configvalue.php b/application/admin/controller/general/Configvalue.php index 892306e5..b23543ff 100644 --- a/application/admin/controller/general/Configvalue.php +++ b/application/admin/controller/general/Configvalue.php @@ -2,7 +2,6 @@ namespace app\admin\controller\general; -use app\admin\model\AdminLog; use app\common\controller\Backend; /** @@ -76,7 +75,6 @@ class Configvalue extends Backend $params['content'] = array_combine($fieldarr, $valuearr); } $this->model->save($params); - AdminLog::record(__('Add'), $this->model->getLastInsID()); $this->code = 1; } @@ -119,7 +117,6 @@ class Configvalue extends Backend $params['content'] = array_combine($fieldarr, $valuearr); } $row->save($params); - AdminLog::record(__('Edit'), $ids); $this->code = 1; } diff --git a/application/admin/controller/general/Database.php b/application/admin/controller/general/Database.php index aa6801da..dcb31e22 100644 --- a/application/admin/controller/general/Database.php +++ b/application/admin/controller/general/Database.php @@ -2,7 +2,6 @@ namespace app\admin\controller\general; -use app\admin\model\AdminLog; use app\common\controller\Backend; use think\Db; use think\Debug; @@ -60,7 +59,6 @@ class Database extends Backend if (in_array($do_action, array('doquery', 'optimizeall', 'repairall'))) { - AdminLog::record(__('query'), ['table' => $tablename, 'action' => $do_action, 'sql' => $this->request->post('sqlquery')]); $this->$do_action(); } else if (count($tablename) == 0) @@ -69,7 +67,6 @@ class Database extends Backend } else { - AdminLog::record(__('query'), ['table' => $tablename, 'action' => $do_action]); foreach ($tablename as $table) { $this->$do_action($table); diff --git a/application/admin/controller/general/Profile.php b/application/admin/controller/general/Profile.php index 1f9c2319..867a102e 100644 --- a/application/admin/controller/general/Profile.php +++ b/application/admin/controller/general/Profile.php @@ -52,7 +52,7 @@ class Profile extends Backend { $this->code = -1; $params = $this->request->post("row/a"); - $params = array_filter(array_intersect_key($params, array_flip(array('email', 'nickname', 'password')))); + $params = array_filter(array_intersect_key($params, array_flip(array('email', 'nickname', 'password', 'avatar')))); unset($v); if (isset($params['password'])) { @@ -62,7 +62,6 @@ class Profile extends Backend if ($params) { model('admin')->where('id', $this->auth->id)->update($params); - AdminLog::record(__('Update'), $params); //因为个人资料面板读取的Session显示,修改自己资料后同时更新Session $admin = Session::get('admin'); $admin_id = $admin ? $admin->id : 0; diff --git a/application/admin/controller/wechat/Autoreply.php b/application/admin/controller/wechat/Autoreply.php index f28ecd6d..2b62300f 100644 --- a/application/admin/controller/wechat/Autoreply.php +++ b/application/admin/controller/wechat/Autoreply.php @@ -2,10 +2,8 @@ namespace app\admin\controller\wechat; -use app\admin\model\AdminLog; use app\common\controller\Backend; use app\common\model\WechatResponse; -use think\Db; /** * 微信自动回复管理 @@ -28,7 +26,7 @@ class Autoreply extends Backend */ public function edit($ids = NULL) { - $row = Db::table($this->table)->where('id', $ids)->get(); + $row = $this->model->get(['id' => $ids]); if (!$row) $this->error(__('No Results were found')); if ($this->request->isPost()) @@ -38,7 +36,6 @@ class Autoreply extends Backend if ($params) { $row->save($params); - AdminLog::record(__('Edit'), $ids); $this->code = 1; } return; diff --git a/application/admin/controller/wechat/Config.php b/application/admin/controller/wechat/Config.php index f23edae5..c7bb8952 100644 --- a/application/admin/controller/wechat/Config.php +++ b/application/admin/controller/wechat/Config.php @@ -2,7 +2,6 @@ namespace app\admin\controller\wechat; -use app\admin\model\AdminLog; use app\common\controller\Backend; use app\common\model\Configvalue; @@ -55,7 +54,6 @@ class Config extends Backend $this->obj['config'][] = $this->request->post('row/a'); $this->wechatcfg->content = $this->obj; $this->wechatcfg->save(); - AdminLog::record(__('Add'), $this->request->post('row/a')); $this->code = 1; return; } @@ -86,7 +84,6 @@ class Config extends Backend $this->wechatcfg->content = $this->obj; $this->wechatcfg->save(); $this->code = 1; - AdminLog::record(__('Edit'), $ids); return; } $this->view->assign("row", $row); @@ -111,7 +108,6 @@ class Config extends Backend } $this->wechatcfg->content = $this->obj; $this->wechatcfg->save(); - AdminLog::record(__('Del'), $ids); $this->code = 1; } diff --git a/application/admin/controller/wechat/Menu.php b/application/admin/controller/wechat/Menu.php index 00ed72ac..be7e09b2 100644 --- a/application/admin/controller/wechat/Menu.php +++ b/application/admin/controller/wechat/Menu.php @@ -2,7 +2,6 @@ namespace app\admin\controller\wechat; -use app\admin\model\AdminLog; use app\common\controller\Backend; use app\common\model\Configvalue; use app\common\model\WechatResponse; @@ -53,7 +52,6 @@ class Menu extends Backend $content['menu'] = $menu; $this->wechatcfg->content = $content; $this->wechatcfg->save(); - AdminLog::record(__('Edit'), $ids); $this->code = 1; return; } @@ -71,7 +69,6 @@ class Menu extends Backend $ret = $app->menu->add($this->wechatcfg->content['menu']); if ($ret->errcode == 0) { - AdminLog::record(__('Sync'), $this->wechatcfg->content['menu']); $this->code = 1; } else diff --git a/application/admin/controller/wechat/Response.php b/application/admin/controller/wechat/Response.php index f5026dad..295fe96b 100644 --- a/application/admin/controller/wechat/Response.php +++ b/application/admin/controller/wechat/Response.php @@ -2,7 +2,6 @@ namespace app\admin\controller\wechat; -use app\admin\model\AdminLog; use app\common\controller\Backend; use fast\service\Wechat; @@ -45,7 +44,6 @@ class Response extends Backend if ($params) { $this->model->save($params); - AdminLog::record(__('Add'), $this->model->getLastInsID()); $this->code = 1; $this->content = $params; } @@ -74,7 +72,6 @@ class Response extends Backend if ($params) { $row->save($params); - AdminLog::record(__('Edit'), $ids); $this->code = 1; } return; diff --git a/application/admin/lang/zh-cn.php b/application/admin/lang/zh-cn.php index 30cbef41..8328d972 100644 --- a/application/admin/lang/zh-cn.php +++ b/application/admin/lang/zh-cn.php @@ -55,6 +55,7 @@ return [ 'Hot' => '热门', 'Recommend' => '推荐', 'Dashboard' => '控制台', + 'Upload' => '上传', 'Code' => '编号', 'Message' => '内容', 'Line' => '行号', @@ -72,7 +73,6 @@ return [ 'Parent' => '父级', 'Params' => '参数', 'Permission' => '权限', - 'Advance search' => '高级搜索', 'Check all' => '选中全部', 'Expand all' => '展开全部', 'Begin time' => '开始时间', @@ -84,9 +84,11 @@ return [ 'Operation failed' => '操作失败!', 'Unknown data format' => '未知的数据格式!', 'Network error' => '网络错误!', - 'Issues & Wiki' => '问题交流', - 'Advanced search' => '高级搜索', + 'Auth manager' => '权限管理', + 'General manager' => '常规管理', + 'Example manager' => '测试管理', 'Common search' => '普通搜索', + 'Search %s' => '搜索 %s', '%d second%s ago' => '%d秒前', '%d minute%s ago' => '%d分钟前', '%d hour%s ago' => '%d小时前', diff --git a/application/admin/library/Auth.php b/application/admin/library/Auth.php index 841447c6..08cc775b 100644 --- a/application/admin/library/Auth.php +++ b/application/admin/library/Auth.php @@ -13,6 +13,7 @@ class Auth extends \fast\Auth { protected $requestUri = ''; + protected $breadcrumb = []; public function __construct() { @@ -203,6 +204,27 @@ class Auth extends \fast\Auth return in_array('*', $this->getRuleIds()) ? TRUE : FALSE; } + /** + * 获得面包屑导航 + * @param string $path + * @return array + */ + public function getBreadCrumb($path = '') + { + if ($this->breadcrumb || !$path) + return $this->breadcrumb; + $path_rule_id = 0; + foreach ($this->rules as $rule) + { + $path_rule_id = $rule['name'] == $path ? $rule['id'] : $path_rule_id; + } + if ($path_rule_id) + { + $this->breadcrumb = Tree::instance()->init($this->rules)->getParents($path_rule_id, true); + } + return $this->breadcrumb; + } + /** * 获取左侧菜单栏 * diff --git a/application/admin/library/traits/Backend.php b/application/admin/library/traits/Backend.php index 4f3b7f48..51cd47c3 100644 --- a/application/admin/library/traits/Backend.php +++ b/application/admin/library/traits/Backend.php @@ -2,7 +2,6 @@ namespace app\admin\library\traits; -use app\admin\model\AdminLog; trait Backend { @@ -49,7 +48,6 @@ trait Backend $v = substr($k, -4) == 'time' && !is_numeric($v) ? strtotime($v) : $v; } $this->model->create($params); - AdminLog::record(__('Add'), $this->model->getLastInsID()); $this->code = 1; } @@ -78,7 +76,6 @@ trait Backend $v = substr($k, -4) == 'time' && !is_numeric($v) ? strtotime($v) : $v; } $row->save($params); - AdminLog::record(__('Edit'), $ids); $this->code = 1; } @@ -99,7 +96,6 @@ trait Backend $count = $this->model->where('id', 'in', $ids)->delete(); if ($count) { - AdminLog::record(__('Del'), $ids); $this->code = 1; } } @@ -125,7 +121,6 @@ trait Backend $count = $this->model->where('id', 'in', $ids)->update($values); if ($count) { - AdminLog::record(__('Multi'), $ids); $this->code = 1; } } diff --git a/application/admin/model/AdminLog.php b/application/admin/model/AdminLog.php index 16aa0ca1..698cb8a9 100644 --- a/application/admin/model/AdminLog.php +++ b/application/admin/model/AdminLog.php @@ -13,19 +13,39 @@ class AdminLog extends Model protected $createTime = 'createtime'; protected $updateTime = ''; - public static function record($title, $content = '', $username = '') + public static function record($title = '') { $admin = \think\Session::get('admin'); $admin_id = $admin ? $admin->id : 0; - $content = !is_scalar($content) ? json_encode($content) : $content . ''; - $username = $username ? $username : ($admin ? $admin->username : __('')); + $username = $admin ? $admin->username : __('Unknown'); + $content = request()->param(); + foreach ($content as $k => $v) + { + if (is_string($v) && strlen($v) > 200) + { + unset($content[$k]); + } + } + $title = []; + $breadcrumb = \app\admin\library\Auth::instance()->getBreadcrumb(); + foreach ($breadcrumb as $k => $v) + { + $title[] = $v['title']; + } self::create([ - 'title' => $title, - 'content' => $content, - 'url' => request()->url(), - 'admin_id' => $admin_id, - 'username' => $username + 'title' => implode(' ', $title), + 'content' => json_encode($content), + 'url' => request()->url(), + 'admin_id' => $admin_id, + 'username' => $username, + 'useragent' => request()->server('HTTP_USER_AGENT'), + 'ip' => request()->ip() ]); } + public function admin() + { + return $this->belongsTo('Admin', 'admin_id')->setEagerlyType(0); + } + } diff --git a/application/admin/tags.php b/application/admin/tags.php new file mode 100644 index 00000000..57d55b8c --- /dev/null +++ b/application/admin/tags.php @@ -0,0 +1,18 @@ + +// +---------------------------------------------------------------------- +// 应用行为扩展定义文件 +return [ + // 应用结束 + 'app_end' => [ + 'app\\admin\\behavior\\AdminLog', + ], +]; diff --git a/application/admin/view/auth/admin/add.html b/application/admin/view/auth/admin/add.html index 537b49e6..c9c4f5e9 100644 --- a/application/admin/view/auth/admin/add.html +++ b/application/admin/view/auth/admin/add.html @@ -8,25 +8,25 @@
- +
- +
- +
- +
diff --git a/application/admin/view/auth/admin/edit.html b/application/admin/view/auth/admin/edit.html index 0c64e324..3df7dd85 100644 --- a/application/admin/view/auth/admin/edit.html +++ b/application/admin/view/auth/admin/edit.html @@ -8,19 +8,19 @@
- +
- +
- +
diff --git a/application/admin/view/category/add.html b/application/admin/view/category/add.html index 08fb31d1..42bb0e67 100644 --- a/application/admin/view/category/add.html +++ b/application/admin/view/category/add.html @@ -42,7 +42,7 @@
- {:build_select('row[flag]', 'h,i,s', null, ['id'=>'c-flag','class'=>'form-control selectpicker','required'=>''])} + {:build_select('row[flag]', ['recommend'=>__('Recommend'), 'index'=>__('Index'), 'hot'=>__('Hot')], null, ['id'=>'c-flag','class'=>'form-control selectpicker','required'=>''])}
diff --git a/application/admin/view/category/edit.html b/application/admin/view/category/edit.html index 3adec277..7ca69a70 100644 --- a/application/admin/view/category/edit.html +++ b/application/admin/view/category/edit.html @@ -42,7 +42,7 @@
- {:build_select('row[flag]', 'h,i,s', $row['flag'], ['id'=>'c-flag','class'=>'form-control selectpicker','required'=>''])} + {:build_select('row[flag]', ['recommend'=>__('Recommend'), 'index'=>__('Index'), 'hot'=>__('Hot')], $row['flag'], ['id'=>'c-flag','class'=>'form-control selectpicker','required'=>''])}
diff --git a/application/admin/view/common/header.html b/application/admin/view/common/header.html index f141ed82..369eb6a5 100644 --- a/application/admin/view/common/header.html +++ b/application/admin/view/common/header.html @@ -83,7 +83,7 @@