diff --git a/application/admin/command/Api.php b/application/admin/command/Api.php index 2c719842701ae1dff779c8f7875c7207e3030ba7..b7ed2b34726a8365def3bc49433103755bf58020 100644 --- a/application/admin/command/Api.php +++ b/application/admin/command/Api.php @@ -37,6 +37,10 @@ class Api extends Command $force = $input->getOption('force'); $url = $input->getOption('url'); $language = $input->getOption('language'); + $template = $input->getOption('template'); + if (!preg_match("/^([a-z0-9]+)\.html\$/i", $template)) { + throw new Exception('template file not correct'); + } $language = $language ? $language : 'zh-cn'; $langFile = $apiDir . 'lang' . DS . $language . '.php'; if (!is_file($langFile)) { @@ -51,7 +55,7 @@ class Api extends Command } // 模板文件 $template_dir = $apiDir . 'template' . DS; - $template_file = $template_dir . $input->getOption('template'); + $template_file = $template_dir . $template; if (!is_file($template_file)) { throw new Exception('template file not found'); } diff --git a/application/admin/command/Api/library/Builder.php b/application/admin/command/Api/library/Builder.php index 169930abdd0a6106b90e4a29e2001e68a3ba29a4..c36215014922210bda365a6e07fbbcbffede30e1 100755 --- a/application/admin/command/Api/library/Builder.php +++ b/application/admin/command/Api/library/Builder.php @@ -165,6 +165,10 @@ class Builder $sectorArr = []; foreach ($allClassAnnotations as $index => &$allClassAnnotation) { + // 如果设置隐藏,则不显示在文档 + if (isset($allClassAnnotation['ApiInternal'])) { + continue; + } $sector = isset($allClassAnnotation['ApiSector']) ? $allClassAnnotation['ApiSector'][0] : $allClassAnnotation['ApiTitle'][0]; $sectorArr[$sector] = isset($allClassAnnotation['ApiWeigh']) ? $allClassAnnotation['ApiWeigh'][0] : 0; } diff --git a/application/admin/command/Crud.php b/application/admin/command/Crud.php index bdc2bd0e0a16af3f245c22b9a5fc054977016266..927625b7768c15f457ad8c07cea4e62365390143 100755 --- a/application/admin/command/Crud.php +++ b/application/admin/command/Crud.php @@ -173,6 +173,7 @@ class Crud extends Command ->addOption('switchsuffix', null, Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'automatically generate switch component with suffix', null) ->addOption('citysuffix', null, Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'automatically generate citypicker component with suffix', null) ->addOption('jsonsuffix', null, Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'automatically generate fieldlist component with suffix', null) + ->addOption('editorsuffix', null, Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'automatically generate editor component with suffix', null) ->addOption('selectpagesuffix', null, Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'automatically generate selectpage component with suffix', null) ->addOption('selectpagessuffix', null, Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'automatically generate multiple selectpage component with suffix', null) ->addOption('ignorefields', null, Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'ignore fields', null) diff --git a/application/admin/command/Install.php b/application/admin/command/Install.php index f9da2cd708ce6f26cc6bc53de23f20eda225cad3..99414c3925d4a4bda4f59c4817450872f42df48f 100644 --- a/application/admin/command/Install.php +++ b/application/admin/command/Install.php @@ -294,8 +294,8 @@ class Install extends Command //数据库配置文件 $dbConfigFile = APP_PATH . 'database.php'; - if (version_compare(PHP_VERSION, '7.0.0', '<')) { - throw new Exception(__("The current version %s is too low, please use PHP 7.0 or higher", PHP_VERSION)); + if (version_compare(PHP_VERSION, '7.1.0', '<')) { + throw new Exception(__("The current version %s is too low, please use PHP 7.1 or higher", PHP_VERSION)); } if (!extension_loaded("PDO")) { throw new Exception(__("PDO is not currently installed and cannot be installed")); diff --git a/application/admin/command/Install/fastadmin.sql b/application/admin/command/Install/fastadmin.sql index e666849ccf0e6b421b98964fc396721c22651a59..4803eb5b6499ff9208d3c69d7a220561c3bb6aac 100755 --- a/application/admin/command/Install/fastadmin.sql +++ b/application/admin/command/Install/fastadmin.sql @@ -32,7 +32,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@admin.com', 0, 1502029281, '127.0.0.1',1492186163, 1502029281, 'd3992c3b-5ecc-4ecb-9dc2-8997780fcadc', 'normal'); +INSERT INTO `fa_admin` VALUES (1, 'admin', 'Admin', '', '', '/assets/img/avatar.png', 'admin@admin.com', 0, 1491635035, '127.0.0.1',1491635035, 1491635035, '', 'normal'); COMMIT; -- ---------------------------- @@ -103,7 +103,7 @@ CREATE TABLE `fa_attachment` ( -- Records of fa_attachment -- ---------------------------- BEGIN; -INSERT INTO `fa_attachment` VALUES (1, 1, 0, '/assets/img/qrcode.png', '150', '150', 'png', 0, 'qrcode.png', 21859, 'image/png', '', 1499681848, 1499681848, 1499681848, 'local', '17163603d0263e4838b9387ff2cd4877e8b018f6'); +INSERT INTO `fa_attachment` VALUES (1, 1, 0, '/assets/img/qrcode.png', '150', '150', 'png', 0, 'qrcode.png', 21859, 'image/png', '', 1491635035, 1491635035, 1491635035, 'local', '17163603d0263e4838b9387ff2cd4877e8b018f6'); COMMIT; -- ---------------------------- @@ -125,11 +125,11 @@ CREATE TABLE `fa_auth_group` ( -- Records of fa_auth_group -- ---------------------------- BEGIN; -INSERT INTO `fa_auth_group` VALUES (1, 0, 'Admin group', '*', 1490883540, 149088354, 'normal'); -INSERT INTO `fa_auth_group` VALUES (2, 1, 'Second group', '13,14,16,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,40,41,42,43,44,45,46,47,48,49,50,55,56,57,58,59,60,61,62,63,64,65,1,9,10,11,7,6,8,2,4,5', 1490883540, 1505465692, 'normal'); -INSERT INTO `fa_auth_group` VALUES (3, 2, 'Third group', '1,4,9,10,11,13,14,15,16,17,40,41,42,43,44,45,46,47,48,49,50,55,56,57,58,59,60,61,62,63,64,65,5', 1490883540, 1502205322, 'normal'); -INSERT INTO `fa_auth_group` VALUES (4, 1, 'Second group 2', '1,4,13,14,15,16,17,55,56,57,58,59,60,61,62,63,64,65', 1490883540, 1502205350, 'normal'); -INSERT INTO `fa_auth_group` VALUES (5, 2, 'Third group 2', '1,2,6,7,8,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34', 1490883540, 1502205344, 'normal'); +INSERT INTO `fa_auth_group` VALUES (1, 0, 'Admin group', '*', 1491635035, 1491635035, 'normal'); +INSERT INTO `fa_auth_group` VALUES (2, 1, 'Second group', '13,14,16,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,40,41,42,43,44,45,46,47,48,49,50,55,56,57,58,59,60,61,62,63,64,65,1,9,10,11,7,6,8,2,4,5', 1491635035, 1491635035, 'normal'); +INSERT INTO `fa_auth_group` VALUES (3, 2, 'Third group', '1,4,9,10,11,13,14,15,16,17,40,41,42,43,44,45,46,47,48,49,50,55,56,57,58,59,60,61,62,63,64,65,5', 1491635035, 1491635035, 'normal'); +INSERT INTO `fa_auth_group` VALUES (4, 1, 'Second group 2', '1,4,13,14,15,16,17,55,56,57,58,59,60,61,62,63,64,65', 1491635035, 1491635035, 'normal'); +INSERT INTO `fa_auth_group` VALUES (5, 2, 'Third group 2', '1,2,6,7,8,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34', 1491635035, 1491635035, 'normal'); COMMIT; -- ---------------------------- @@ -165,6 +165,8 @@ CREATE TABLE `fa_auth_rule` ( `condition` varchar(255) DEFAULT '' COMMENT '条件', `remark` varchar(255) DEFAULT '' COMMENT '备注', `ismenu` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否为菜单', + `menutype` enum('addtabs','blank','dialog','ajax') DEFAULT NULL COMMENT '菜单类型', + `extend` varchar(255) DEFAULT '' COMMENT '扩展属性', `createtime` int(10) DEFAULT NULL COMMENT '创建时间', `updatetime` int(10) DEFAULT NULL COMMENT '更新时间', `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重', @@ -179,88 +181,88 @@ CREATE TABLE `fa_auth_rule` ( -- Records of fa_auth_rule -- ---------------------------- BEGIN; -INSERT INTO `fa_auth_rule` VALUES (1, 'file', 0, 'dashboard', 'Dashboard', 'fa fa-dashboard', '', 'Dashboard tips', 1, 1497429920, 1497429920, 143, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (2, 'file', 0, 'general', 'General', 'fa fa-cogs', '', '', 1, 1497429920, 1497430169, 137, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (3, 'file', 0, 'category', 'Category', 'fa fa-leaf', '', 'Category tips', 1, 1497429920, 1497429920, 119, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (4, 'file', 0, 'addon', 'Addon', 'fa fa-rocket', '', 'Addon tips', 1, 1502035509, 1502035509, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (5, 'file', 0, 'auth', 'Auth', 'fa fa-group', '', '', 1, 1497429920, 1497430092, 99, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (6, 'file', 2, 'general/config', 'Config', 'fa fa-cog', '', 'Config tips', 1, 1497429920, 1497430683, 60, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (7, 'file', 2, 'general/attachment', 'Attachment', 'fa fa-file-image-o', '', 'Attachment tips', 1, 1497429920, 1497430699, 53, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (8, 'file', 2, 'general/profile', 'Profile', 'fa fa-user', '', '', 1, 1497429920, 1497429920, 34, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (9, 'file', 5, 'auth/admin', 'Admin', 'fa fa-user', '', 'Admin tips', 1, 1497429920, 1497430320, 118, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (10, 'file', 5, 'auth/adminlog', 'Admin log', 'fa fa-list-alt', '', 'Admin log tips', 1, 1497429920, 1497430307, 113, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (11, 'file', 5, 'auth/group', 'Group', 'fa fa-group', '', 'Group tips', 1, 1497429920, 1497429920, 109, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (12, 'file', 5, 'auth/rule', 'Rule', 'fa fa-bars', '', 'Rule tips', 1, 1497429920, 1497430581, 104, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (13, 'file', 1, 'dashboard/index', 'View', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 136, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (14, 'file', 1, 'dashboard/add', 'Add', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 135, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (15, 'file', 1, 'dashboard/del', 'Delete', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 133, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (16, 'file', 1, 'dashboard/edit', 'Edit', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 134, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (17, 'file', 1, 'dashboard/multi', 'Multi', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 132, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (18, 'file', 6, 'general/config/index', 'View', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 52, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (19, 'file', 6, 'general/config/add', 'Add', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 51, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (20, 'file', 6, 'general/config/edit', 'Edit', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 50, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (21, 'file', 6, 'general/config/del', 'Delete', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 49, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (22, 'file', 6, 'general/config/multi', 'Multi', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 48, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (23, 'file', 7, 'general/attachment/index', 'View', 'fa fa-circle-o', '', 'Attachment tips', 0, 1497429920, 1497429920, 59, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (24, 'file', 7, 'general/attachment/select', 'Select attachment', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 58, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (25, 'file', 7, 'general/attachment/add', 'Add', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 57, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (26, 'file', 7, 'general/attachment/edit', 'Edit', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 56, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (27, 'file', 7, 'general/attachment/del', 'Delete', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 55, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (28, 'file', 7, 'general/attachment/multi', 'Multi', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 54, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (29, 'file', 8, 'general/profile/index', 'View', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 33, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (30, 'file', 8, 'general/profile/update', 'Update profile', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 32, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (31, 'file', 8, 'general/profile/add', 'Add', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 31, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (32, 'file', 8, 'general/profile/edit', 'Edit', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 30, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (33, 'file', 8, 'general/profile/del', 'Delete', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 29, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (34, 'file', 8, 'general/profile/multi', 'Multi', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 28, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (35, 'file', 3, 'category/index', 'View', 'fa fa-circle-o', '', 'Category tips', 0, 1497429920, 1497429920, 142, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (36, 'file', 3, 'category/add', 'Add', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 141, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (37, 'file', 3, 'category/edit', 'Edit', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 140, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (38, 'file', 3, 'category/del', 'Delete', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 139, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (39, 'file', 3, 'category/multi', 'Multi', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 138, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (40, 'file', 9, 'auth/admin/index', 'View', 'fa fa-circle-o', '', 'Admin tips', 0, 1497429920, 1497429920, 117, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (41, 'file', 9, 'auth/admin/add', 'Add', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 116, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (42, 'file', 9, 'auth/admin/edit', 'Edit', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 115, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (43, 'file', 9, 'auth/admin/del', 'Delete', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 114, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (44, 'file', 10, 'auth/adminlog/index', 'View', 'fa fa-circle-o', '', 'Admin log tips', 0, 1497429920, 1497429920, 112, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (45, 'file', 10, 'auth/adminlog/detail', 'Detail', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 111, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (46, 'file', 10, 'auth/adminlog/del', 'Delete', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 110, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (47, 'file', 11, 'auth/group/index', 'View', 'fa fa-circle-o', '', 'Group tips', 0, 1497429920, 1497429920, 108, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (48, 'file', 11, 'auth/group/add', 'Add', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 107, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (49, 'file', 11, 'auth/group/edit', 'Edit', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 106, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (50, 'file', 11, 'auth/group/del', 'Delete', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 105, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (51, 'file', 12, 'auth/rule/index', 'View', 'fa fa-circle-o', '', 'Rule tips', 0, 1497429920, 1497429920, 103, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (52, 'file', 12, 'auth/rule/add', 'Add', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 102, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (53, 'file', 12, 'auth/rule/edit', 'Edit', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 101, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (54, 'file', 12, 'auth/rule/del', 'Delete', 'fa fa-circle-o', '', '', 0, 1497429920, 1497429920, 100, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (55, 'file', 4, 'addon/index', 'View', 'fa fa-circle-o', '', 'Addon tips', 0, 1502035509, 1502035509, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (56, 'file', 4, 'addon/add', 'Add', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (57, 'file', 4, 'addon/edit', 'Edit', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (58, 'file', 4, 'addon/del', 'Delete', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (59, 'file', 4, 'addon/downloaded', 'Local addon', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (60, 'file', 4, 'addon/state', 'Update state', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (63, 'file', 4, 'addon/config', 'Setting', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (64, 'file', 4, 'addon/refresh', 'Refresh', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (65, 'file', 4, 'addon/multi', 'Multi', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (66, 'file', 0, 'user', 'User', 'fa fa-list', '', '', 1, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (67, 'file', 66, 'user/user', 'User', 'fa fa-user', '', '', 1, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (68, 'file', 67, 'user/user/index', 'View', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (69, 'file', 67, 'user/user/edit', 'Edit', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (70, 'file', 67, 'user/user/add', 'Add', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (71, 'file', 67, 'user/user/del', 'Del', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (72, 'file', 67, 'user/user/multi', 'Multi', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (73, 'file', 66, 'user/group', 'User group', 'fa fa-users', '', '', 1, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (74, 'file', 73, 'user/group/add', 'Add', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (75, 'file', 73, 'user/group/edit', 'Edit', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (76, 'file', 73, 'user/group/index', 'View', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (77, 'file', 73, 'user/group/del', 'Del', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (78, 'file', 73, 'user/group/multi', 'Multi', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (79, 'file', 66, 'user/rule', 'User rule', 'fa fa-circle-o', '', '', 1, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (80, 'file', 79, 'user/rule/index', 'View', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (81, 'file', 79, 'user/rule/del', 'Del', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (82, 'file', 79, 'user/rule/add', 'Add', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (83, 'file', 79, 'user/rule/edit', 'Edit', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (84, 'file', 79, 'user/rule/multi', 'Multi', 'fa fa-circle-o', '', '', 0, 1516374729, 1516374729, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (1, 'file', 0, 'dashboard', 'Dashboard', 'fa fa-dashboard', '', 'Dashboard tips', 1, NULL, '', 1491635035, 1491635035, 143, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (2, 'file', 0, 'general', 'General', 'fa fa-cogs', '', '', 1, NULL, '', 1491635035, 1491635035, 137, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (3, 'file', 0, 'category', 'Category', 'fa fa-leaf', '', 'Category tips', 1, NULL, '', 1491635035, 1491635035, 119, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (4, 'file', 0, 'addon', 'Addon', 'fa fa-rocket', '', 'Addon tips', 1, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (5, 'file', 0, 'auth', 'Auth', 'fa fa-group', '', '', 1, NULL, '', 1491635035, 1491635035, 99, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (6, 'file', 2, 'general/config', 'Config', 'fa fa-cog', '', 'Config tips', 1, NULL, '', 1491635035, 1491635035, 60, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (7, 'file', 2, 'general/attachment', 'Attachment', 'fa fa-file-image-o', '', 'Attachment tips', 1, NULL, '', 1491635035, 1491635035, 53, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (8, 'file', 2, 'general/profile', 'Profile', 'fa fa-user', '', '', 1, NULL, '', 1491635035, 1491635035, 34, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (9, 'file', 5, 'auth/admin', 'Admin', 'fa fa-user', '', 'Admin tips', 1, NULL, '', 1491635035, 1491635035, 118, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (10, 'file', 5, 'auth/adminlog', 'Admin log', 'fa fa-list-alt', '', 'Admin log tips', 1, NULL, '', 1491635035, 1491635035, 113, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (11, 'file', 5, 'auth/group', 'Group', 'fa fa-group', '', 'Group tips', 1, NULL, '', 1491635035, 1491635035, 109, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (12, 'file', 5, 'auth/rule', 'Rule', 'fa fa-bars', '', 'Rule tips', 1, NULL, '', 1491635035, 1491635035, 104, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (13, 'file', 1, 'dashboard/index', 'View', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 136, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (14, 'file', 1, 'dashboard/add', 'Add', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 135, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (15, 'file', 1, 'dashboard/del', 'Delete', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 133, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (16, 'file', 1, 'dashboard/edit', 'Edit', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 134, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (17, 'file', 1, 'dashboard/multi', 'Multi', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 132, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (18, 'file', 6, 'general/config/index', 'View', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 52, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (19, 'file', 6, 'general/config/add', 'Add', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 51, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (20, 'file', 6, 'general/config/edit', 'Edit', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 50, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (21, 'file', 6, 'general/config/del', 'Delete', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 49, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (22, 'file', 6, 'general/config/multi', 'Multi', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 48, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (23, 'file', 7, 'general/attachment/index', 'View', 'fa fa-circle-o', '', 'Attachment tips', 0, NULL, '', 1491635035, 1491635035, 59, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (24, 'file', 7, 'general/attachment/select', 'Select attachment', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 58, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (25, 'file', 7, 'general/attachment/add', 'Add', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 57, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (26, 'file', 7, 'general/attachment/edit', 'Edit', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 56, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (27, 'file', 7, 'general/attachment/del', 'Delete', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 55, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (28, 'file', 7, 'general/attachment/multi', 'Multi', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 54, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (29, 'file', 8, 'general/profile/index', 'View', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 33, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (30, 'file', 8, 'general/profile/update', 'Update profile', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 32, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (31, 'file', 8, 'general/profile/add', 'Add', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 31, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (32, 'file', 8, 'general/profile/edit', 'Edit', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 30, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (33, 'file', 8, 'general/profile/del', 'Delete', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 29, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (34, 'file', 8, 'general/profile/multi', 'Multi', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 28, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (35, 'file', 3, 'category/index', 'View', 'fa fa-circle-o', '', 'Category tips', 0, NULL, '', 1491635035, 1491635035, 142, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (36, 'file', 3, 'category/add', 'Add', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 141, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (37, 'file', 3, 'category/edit', 'Edit', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 140, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (38, 'file', 3, 'category/del', 'Delete', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 139, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (39, 'file', 3, 'category/multi', 'Multi', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 138, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (40, 'file', 9, 'auth/admin/index', 'View', 'fa fa-circle-o', '', 'Admin tips', 0, NULL, '', 1491635035, 1491635035, 117, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (41, 'file', 9, 'auth/admin/add', 'Add', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 116, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (42, 'file', 9, 'auth/admin/edit', 'Edit', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 115, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (43, 'file', 9, 'auth/admin/del', 'Delete', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 114, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (44, 'file', 10, 'auth/adminlog/index', 'View', 'fa fa-circle-o', '', 'Admin log tips', 0, NULL, '', 1491635035, 1491635035, 112, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (45, 'file', 10, 'auth/adminlog/detail', 'Detail', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 111, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (46, 'file', 10, 'auth/adminlog/del', 'Delete', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 110, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (47, 'file', 11, 'auth/group/index', 'View', 'fa fa-circle-o', '', 'Group tips', 0, NULL, '', 1491635035, 1491635035, 108, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (48, 'file', 11, 'auth/group/add', 'Add', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 107, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (49, 'file', 11, 'auth/group/edit', 'Edit', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 106, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (50, 'file', 11, 'auth/group/del', 'Delete', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 105, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (51, 'file', 12, 'auth/rule/index', 'View', 'fa fa-circle-o', '', 'Rule tips', 0, NULL, '', 1491635035, 1491635035, 103, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (52, 'file', 12, 'auth/rule/add', 'Add', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 102, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (53, 'file', 12, 'auth/rule/edit', 'Edit', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 101, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (54, 'file', 12, 'auth/rule/del', 'Delete', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 100, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (55, 'file', 4, 'addon/index', 'View', 'fa fa-circle-o', '', 'Addon tips', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (56, 'file', 4, 'addon/add', 'Add', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (57, 'file', 4, 'addon/edit', 'Edit', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (58, 'file', 4, 'addon/del', 'Delete', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (59, 'file', 4, 'addon/downloaded', 'Local addon', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (60, 'file', 4, 'addon/state', 'Update state', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (63, 'file', 4, 'addon/config', 'Setting', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (64, 'file', 4, 'addon/refresh', 'Refresh', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (65, 'file', 4, 'addon/multi', 'Multi', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (66, 'file', 0, 'user', 'User', 'fa fa-list', '', '', 1, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (67, 'file', 66, 'user/user', 'User', 'fa fa-user', '', '', 1, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (68, 'file', 67, 'user/user/index', 'View', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (69, 'file', 67, 'user/user/edit', 'Edit', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (70, 'file', 67, 'user/user/add', 'Add', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (71, 'file', 67, 'user/user/del', 'Del', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (72, 'file', 67, 'user/user/multi', 'Multi', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (73, 'file', 66, 'user/group', 'User group', 'fa fa-users', '', '', 1, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (74, 'file', 73, 'user/group/add', 'Add', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (75, 'file', 73, 'user/group/edit', 'Edit', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (76, 'file', 73, 'user/group/index', 'View', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (77, 'file', 73, 'user/group/del', 'Del', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (78, 'file', 73, 'user/group/multi', 'Multi', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (79, 'file', 66, 'user/rule', 'User rule', 'fa fa-circle-o', '', '', 1, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (80, 'file', 79, 'user/rule/index', 'View', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (81, 'file', 79, 'user/rule/del', 'Del', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (82, 'file', 79, 'user/rule/add', 'Add', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (83, 'file', 79, 'user/rule/edit', 'Edit', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (84, 'file', 79, 'user/rule/multi', 'Multi', 'fa fa-circle-o', '', '', 0, NULL, '', 1491635035, 1491635035, 0, 'normal'); COMMIT; -- ---------------------------- @@ -291,19 +293,19 @@ CREATE TABLE `fa_category` ( -- Records of fa_category -- ---------------------------- BEGIN; -INSERT INTO `fa_category` VALUES (1, 0, 'page', '官方新闻', 'news', 'recommend', '/assets/img/qrcode.png', '', '', 'news', 1495262190, 1495262190, 1, 'normal'); -INSERT INTO `fa_category` VALUES (2, 0, 'page', '移动应用', 'mobileapp', 'hot', '/assets/img/qrcode.png', '', '', 'mobileapp', 1495262244, 1495262244, 2, 'normal'); -INSERT INTO `fa_category` VALUES (3, 2, 'page', '微信公众号', 'wechatpublic', 'index', '/assets/img/qrcode.png', '', '', 'wechatpublic', 1495262288, 1495262288, 3, 'normal'); -INSERT INTO `fa_category` VALUES (4, 2, 'page', 'Android开发', 'android', 'recommend', '/assets/img/qrcode.png', '', '', 'android', 1495262317, 1495262317, 4, 'normal'); -INSERT INTO `fa_category` VALUES (5, 0, 'page', '软件产品', 'software', 'recommend', '/assets/img/qrcode.png', '', '', 'software', 1495262336, 1499681850, 5, 'normal'); -INSERT INTO `fa_category` VALUES (6, 5, 'page', '网站建站', 'website', 'recommend', '/assets/img/qrcode.png', '', '', 'website', 1495262357, 1495262357, 6, 'normal'); -INSERT INTO `fa_category` VALUES (7, 5, 'page', '企业管理软件', 'company', 'index', '/assets/img/qrcode.png', '', '', 'company', 1495262391, 1495262391, 7, 'normal'); -INSERT INTO `fa_category` VALUES (8, 6, 'page', 'PC端', 'website-pc', 'recommend', '/assets/img/qrcode.png', '', '', 'website-pc', 1495262424, 1495262424, 8, 'normal'); -INSERT INTO `fa_category` VALUES (9, 6, 'page', '移动端', 'website-mobile', 'recommend', '/assets/img/qrcode.png', '', '', 'website-mobile', 1495262456, 1495262456, 9, 'normal'); -INSERT INTO `fa_category` VALUES (10, 7, 'page', 'CRM系统 ', 'company-crm', 'recommend', '/assets/img/qrcode.png', '', '', 'company-crm', 1495262487, 1495262487, 10, 'normal'); -INSERT INTO `fa_category` VALUES (11, 7, 'page', 'SASS平台软件', 'company-sass', 'recommend', '/assets/img/qrcode.png', '', '', 'company-sass', 1495262515, 1495262515, 11, 'normal'); -INSERT INTO `fa_category` VALUES (12, 0, 'test', '测试1', 'test1', 'recommend', '/assets/img/qrcode.png', '', '', 'test1', 1497015727, 1497015727, 12, 'normal'); -INSERT INTO `fa_category` VALUES (13, 0, 'test', '测试2', 'test2', 'recommend', '/assets/img/qrcode.png', '', '', 'test2', 1497015738, 1497015738, 13, 'normal'); +INSERT INTO `fa_category` VALUES (1, 0, 'page', '官方新闻', 'news', 'recommend', '/assets/img/qrcode.png', '', '', 'news', 1491635035, 1491635035, 1, 'normal'); +INSERT INTO `fa_category` VALUES (2, 0, 'page', '移动应用', 'mobileapp', 'hot', '/assets/img/qrcode.png', '', '', 'mobileapp', 1491635035, 1491635035, 2, 'normal'); +INSERT INTO `fa_category` VALUES (3, 2, 'page', '微信公众号', 'wechatpublic', 'index', '/assets/img/qrcode.png', '', '', 'wechatpublic', 1491635035, 1491635035, 3, 'normal'); +INSERT INTO `fa_category` VALUES (4, 2, 'page', 'Android开发', 'android', 'recommend', '/assets/img/qrcode.png', '', '', 'android', 1491635035, 1491635035, 4, 'normal'); +INSERT INTO `fa_category` VALUES (5, 0, 'page', '软件产品', 'software', 'recommend', '/assets/img/qrcode.png', '', '', 'software', 1491635035, 1491635035, 5, 'normal'); +INSERT INTO `fa_category` VALUES (6, 5, 'page', '网站建站', 'website', 'recommend', '/assets/img/qrcode.png', '', '', 'website', 1491635035, 1491635035, 6, 'normal'); +INSERT INTO `fa_category` VALUES (7, 5, 'page', '企业管理软件', 'company', 'index', '/assets/img/qrcode.png', '', '', 'company', 1491635035, 1491635035, 7, 'normal'); +INSERT INTO `fa_category` VALUES (8, 6, 'page', 'PC端', 'website-pc', 'recommend', '/assets/img/qrcode.png', '', '', 'website-pc', 1491635035, 1491635035, 8, 'normal'); +INSERT INTO `fa_category` VALUES (9, 6, 'page', '移动端', 'website-mobile', 'recommend', '/assets/img/qrcode.png', '', '', 'website-mobile', 1491635035, 1491635035, 9, 'normal'); +INSERT INTO `fa_category` VALUES (10, 7, 'page', 'CRM系统 ', 'company-crm', 'recommend', '/assets/img/qrcode.png', '', '', 'company-crm', 1491635035, 1491635035, 10, 'normal'); +INSERT INTO `fa_category` VALUES (11, 7, 'page', 'SASS平台软件', 'company-sass', 'recommend', '/assets/img/qrcode.png', '', '', 'company-sass', 1491635035, 1491635035, 11, 'normal'); +INSERT INTO `fa_category` VALUES (12, 0, 'test', '测试1', 'test1', 'recommend', '/assets/img/qrcode.png', '', '', 'test1', 1491635035, 1491635035, 12, 'normal'); +INSERT INTO `fa_category` VALUES (13, 0, 'test', '测试2', 'test2', 'recommend', '/assets/img/qrcode.png', '', '', 'test2', 1491635035, 1491635035, 13, 'normal'); COMMIT; -- ---------------------------- @@ -422,7 +424,7 @@ CREATE TABLE `fa_test` ( -- Records of fa_test -- ---------------------------- BEGIN; -INSERT INTO `fa_test` VALUES (1, 0, 12, '12,13', 'monday', 'hot,index', 'male', 'music,reading', '我是一篇测试文章', '

我是测试内容

', '/assets/img/avatar.png', '/assets/img/avatar.png,/assets/img/qrcode.png', '/assets/img/avatar.png', '关键字', '描述', '广西壮族自治区/百色市/平果县', '{\"a\":\"1\",\"b\":\"2\"}', 0.00, 0, '2017-07-10', '2017-07-10 18:24:45', 2017, '18:24:45', 1499682285, 1499682526, 1499682526, NULL, 0, 1, 'normal', '1'); +INSERT INTO `fa_test` VALUES (1, 0, 12, '12,13', 'monday', 'hot,index', 'male', 'music,reading', '我是一篇测试文章', '

我是测试内容

', '/assets/img/avatar.png', '/assets/img/avatar.png,/assets/img/qrcode.png', '/assets/img/avatar.png', '关键字', '描述', '广西壮族自治区/百色市/平果县', '{\"a\":\"1\",\"b\":\"2\"}', 0.00, 0, '2017-07-10', '2017-07-10 18:24:45', 2017, '18:24:45', 1491635035, 1491635035, 1491635035, NULL, 0, 1, 'normal', '1'); COMMIT; -- ---------------------------- @@ -468,7 +470,7 @@ CREATE TABLE `fa_user` ( -- Records of fa_user -- ---------------------------- BEGIN; -INSERT INTO `fa_user` VALUES (1, 1, 'admin', 'admin', 'c13f62012fd6a8fdf06b3452a94430e5', 'rpR6Bv', 'admin@163.com', '13888888888', '', 0, 0, '2017-04-15', '', 0, 0, 1, 1, 1516170492, 1516171614, '127.0.0.1', 0, '127.0.0.1', 1491461418, 0, 1516171614, '', 'normal',''); +INSERT INTO `fa_user` VALUES (1, 1, 'admin', 'admin', '', '', 'admin@163.com', '13888888888', '', 0, 0, '2017-04-08', '', 0, 0, 1, 1, 1491635035, 1491635035, '127.0.0.1', 0, '127.0.0.1', 1491635035, 0, 1491635035, '', 'normal',''); COMMIT; -- ---------------------------- @@ -489,7 +491,7 @@ CREATE TABLE `fa_user_group` ( -- Records of fa_user_group -- ---------------------------- BEGIN; -INSERT INTO `fa_user_group` VALUES (1, '默认组', '1,2,3,4,5,6,7,8,9,10,11,12', 1515386468, 1516168298, 'normal'); +INSERT INTO `fa_user_group` VALUES (1, '默认组', '1,2,3,4,5,6,7,8,9,10,11,12', 1491635035, 1491635035, 'normal'); COMMIT; -- ---------------------------- @@ -529,18 +531,18 @@ CREATE TABLE `fa_user_rule` ( -- Records of fa_user_rule -- ---------------------------- BEGIN; -INSERT INTO `fa_user_rule` VALUES (1, 0, 'index', 'Frontend', '', 1, 1516168079, 1516168079, 1, 'normal'); -INSERT INTO `fa_user_rule` VALUES (2, 0, 'api', 'API Interface', '', 1, 1516168062, 1516168062, 2, 'normal'); -INSERT INTO `fa_user_rule` VALUES (3, 1, 'user', 'User Module', '', 1, 1515386221, 1516168103, 12, 'normal'); -INSERT INTO `fa_user_rule` VALUES (4, 2, 'user', 'User Module', '', 1, 1515386221, 1516168092, 11, 'normal'); -INSERT INTO `fa_user_rule` VALUES (5, 3, 'index/user/login', 'Login', '', 0, 1515386247, 1515386247, 5, 'normal'); -INSERT INTO `fa_user_rule` VALUES (6, 3, 'index/user/register', 'Register', '', 0, 1515386262, 1516015236, 7, 'normal'); -INSERT INTO `fa_user_rule` VALUES (7, 3, 'index/user/index', 'User Center', '', 0, 1516015012, 1516015012, 9, 'normal'); -INSERT INTO `fa_user_rule` VALUES (8, 3, 'index/user/profile', 'Profile', '', 0, 1516015012, 1516015012, 4, 'normal'); -INSERT INTO `fa_user_rule` VALUES (9, 4, 'api/user/login', 'Login', '', 0, 1515386247, 1515386247, 6, 'normal'); -INSERT INTO `fa_user_rule` VALUES (10, 4, 'api/user/register', 'Register', '', 0, 1515386262, 1516015236, 8, 'normal'); -INSERT INTO `fa_user_rule` VALUES (11, 4, 'api/user/index', 'User Center', '', 0, 1516015012, 1516015012, 10, 'normal'); -INSERT INTO `fa_user_rule` VALUES (12, 4, 'api/user/profile', 'Profile', '', 0, 1516015012, 1516015012, 3, 'normal'); +INSERT INTO `fa_user_rule` VALUES (1, 0, 'index', 'Frontend', '', 1, 1491635035, 1491635035, 1, 'normal'); +INSERT INTO `fa_user_rule` VALUES (2, 0, 'api', 'API Interface', '', 1, 1491635035, 1491635035, 2, 'normal'); +INSERT INTO `fa_user_rule` VALUES (3, 1, 'user', 'User Module', '', 1, 1491635035, 1491635035, 12, 'normal'); +INSERT INTO `fa_user_rule` VALUES (4, 2, 'user', 'User Module', '', 1, 1491635035, 1491635035, 11, 'normal'); +INSERT INTO `fa_user_rule` VALUES (5, 3, 'index/user/login', 'Login', '', 0, 1491635035, 1491635035, 5, 'normal'); +INSERT INTO `fa_user_rule` VALUES (6, 3, 'index/user/register', 'Register', '', 0, 1491635035, 1491635035, 7, 'normal'); +INSERT INTO `fa_user_rule` VALUES (7, 3, 'index/user/index', 'User Center', '', 0, 1491635035, 1491635035, 9, 'normal'); +INSERT INTO `fa_user_rule` VALUES (8, 3, 'index/user/profile', 'Profile', '', 0, 1491635035, 1491635035, 4, 'normal'); +INSERT INTO `fa_user_rule` VALUES (9, 4, 'api/user/login', 'Login', '', 0, 1491635035, 1491635035, 6, 'normal'); +INSERT INTO `fa_user_rule` VALUES (10, 4, 'api/user/register', 'Register', '', 0, 1491635035, 1491635035, 8, 'normal'); +INSERT INTO `fa_user_rule` VALUES (11, 4, 'api/user/index', 'User Center', '', 0, 1491635035, 1491635035, 10, 'normal'); +INSERT INTO `fa_user_rule` VALUES (12, 4, 'api/user/profile', 'Profile', '', 0, 1491635035, 1491635035, 3, 'normal'); COMMIT; -- ---------------------------- diff --git a/application/admin/command/Install/zh-cn.php b/application/admin/command/Install/zh-cn.php index 26914d025a9a0228952fbff7e5717607ad1d707a..a7dc331af779f9655d31988b54ff585dbf9520da 100644 --- a/application/admin/command/Install/zh-cn.php +++ b/application/admin/command/Install/zh-cn.php @@ -26,7 +26,7 @@ return [ 'Please input correct password' => '密码长度必须在6-16位之间,不能包含空格', 'The two passwords you entered did not match' => '两次输入的密码不一致', 'Please input correct website' => '网站名称输入不正确', - 'The current version %s is too low, please use PHP 7.0 or higher' => '当前版本%s过低,请使用PHP7.0以上版本', + 'The current version %s is too low, please use PHP 7.1 or higher' => '当前版本%s过低,请使用PHP7.1以上版本', 'PDO is not currently installed and cannot be installed' => '当前未开启PDO,无法进行安装', 'The current permissions are insufficient to write the file %s' => '当前权限不足,无法写入文件%s', 'Please go to the official website to download the full package or resource package and try to install' => '当前代码仅包含核心代码,请前往官网下载完整包或资源包覆盖后再尝试安装', diff --git a/application/admin/controller/Dashboard.php b/application/admin/controller/Dashboard.php index 4175baf848d38f89ce78f1d136c6b90629e98538..1cad6b9efb9242383091ca28364878b8b572e433 100644 --- a/application/admin/controller/Dashboard.php +++ b/application/admin/controller/Dashboard.php @@ -2,13 +2,17 @@ namespace app\admin\controller; +use app\admin\model\Admin; +use app\admin\model\User; use app\common\controller\Backend; -use think\Config; +use app\common\model\Attachment; +use fast\Date; +use think\Db; /** * 控制台 * - * @icon fa fa-dashboard + * @icon fa fa-dashboard * @remark 用于展示当前系统中的统计数据、统计报表及重要实时数据 */ class Dashboard extends Backend @@ -19,37 +23,47 @@ class Dashboard extends Backend */ public function index() { - $seventtime = \fast\Date::unixtime('day', -7); - $paylist = $createlist = []; - for ($i = 0; $i < 7; $i++) - { - $day = date("Y-m-d", $seventtime + ($i * 86400)); - $createlist[$day] = mt_rand(20, 200); - $paylist[$day] = mt_rand(1, mt_rand(1, $createlist[$day])); + $column = []; + $starttime = Date::unixtime('day', -6); + $endtime = Date::unixtime('day', 0, 'end'); + $joinlist = Db("user")->where('jointime', 'between time', [$starttime, $endtime]) + ->field('jointime, status, COUNT(*) AS nums, DATE_FORMAT(FROM_UNIXTIME(jointime), "%Y-%m-%d") AS join_date') + ->group('join_date') + ->select(); + for ($time = $starttime; $time <= $endtime;) { + $column[] = date("Y-m-d", $time); + $time += 86400; } - $hooks = config('addons.hooks'); - $uploadmode = isset($hooks['upload_config_init']) && $hooks['upload_config_init'] ? implode(',', $hooks['upload_config_init']) : 'local'; - $addonComposerCfg = ROOT_PATH . '/vendor/karsonzhang/fastadmin-addons/composer.json'; - Config::parse($addonComposerCfg, "json", "composer"); - $config = Config::get("composer"); - $addonVersion = isset($config['version']) ? $config['version'] : __('Unknown'); + $userlist = array_fill_keys($column, 0); + foreach ($joinlist as $k => $v) { + $userlist[$v['join_date']] = $v['nums']; + } + + $dbTableList = Db::query("SHOW TABLE STATUS"); $this->view->assign([ - 'totaluser' => 35200, - 'totalviews' => 219390, - 'totalorder' => 32143, - 'totalorderamount' => 174800, - 'todayuserlogin' => 321, - 'todayusersignup' => 430, - 'todayorder' => 2324, - 'unsettleorder' => 132, - 'sevendnu' => '80%', - 'sevendau' => '32%', - 'paylist' => $paylist, - 'createlist' => $createlist, - 'addonversion' => $addonVersion, - 'uploadmode' => $uploadmode + 'totaluser' => User::count(), + 'totaladdon' => count(get_addon_list()), + 'totaladmin' => Admin::count(), + 'totalcategory' => \app\common\model\Category::count(), + 'todayusersignup' => User::whereTime('jointime', 'today')->count(), + 'todayuserlogin' => User::whereTime('logintime', 'today')->count(), + 'sevendau' => User::whereTime('jointime|logintime|prevtime', '-7 days')->count(), + 'thirtydau' => User::whereTime('jointime|logintime|prevtime', '-30 days')->count(), + 'threednu' => User::whereTime('jointime', '-3 days')->count(), + 'sevendnu' => User::whereTime('jointime', '-7 days')->count(), + 'dbtablenums' => count($dbTableList), + 'dbsize' => array_sum(array_map(function ($item) { + return $item['Data_length'] + $item['Index_length']; + }, $dbTableList)), + 'attachmentnums' => Attachment::count(), + 'attachmentsize' => Attachment::sum('filesize'), + 'picturenums' => Attachment::where('mimetype', 'like', 'image/%')->count(), + 'picturesize' => Attachment::where('mimetype', 'like', 'image/%')->sum('filesize'), ]); + $this->assignconfig('column', array_keys($userlist)); + $this->assignconfig('userdata', array_values($userlist)); + return $this->view->fetch(); } diff --git a/application/admin/controller/auth/Admin.php b/application/admin/controller/auth/Admin.php index e7153dde26ba6adc0ce209199910e7b793bf03aa..aee9c13abe2d233a03b32b7ff237a325748002dc 100644 --- a/application/admin/controller/auth/Admin.php +++ b/application/admin/controller/auth/Admin.php @@ -7,6 +7,7 @@ use app\admin\model\AuthGroupAccess; use app\common\controller\Backend; use fast\Random; use fast\Tree; +use think\Db; use think\Validate; /** @@ -122,32 +123,39 @@ class Admin extends Backend $this->token(); $params = $this->request->post("row/a"); if ($params) { - if (!Validate::is($params['password'], '\S{6,16}')) { - $this->error(__("Please input correct password")); - } - $params['salt'] = Random::alnum(); - $params['password'] = md5(md5($params['password']) . $params['salt']); - $params['avatar'] = '/assets/img/avatar.png'; //设置新管理员默认头像。 - $result = $this->model->validate('Admin.add')->save($params); - if ($result === false) { - $this->error($this->model->getError()); - } - $group = $this->request->post("group/a"); + Db::startTrans(); + try { + if (!Validate::is($params['password'], '\S{6,16}')) { + exception(__("Please input correct password")); + } + $params['salt'] = Random::alnum(); + $params['password'] = md5(md5($params['password']) . $params['salt']); + $params['avatar'] = '/assets/img/avatar.png'; //设置新管理员默认头像。 + $result = $this->model->validate('Admin.add')->save($params); + if ($result === false) { + exception($this->model->getError()); + } + $group = $this->request->post("group/a"); - //过滤不允许的组别,避免越权 - $group = array_intersect($this->childrenGroupIds, $group); - if (!$group) { - $this->error(__('The parent group exceeds permission limit')); - } + //过滤不允许的组别,避免越权 + $group = array_intersect($this->childrenGroupIds, $group); + if (!$group) { + exception(__('The parent group exceeds permission limit')); + } - $dataset = []; - foreach ($group as $value) { - $dataset[] = ['uid' => $this->model->id, 'group_id' => $value]; + $dataset = []; + foreach ($group as $value) { + $dataset[] = ['uid' => $this->model->id, 'group_id' => $value]; + } + model('AuthGroupAccess')->saveAll($dataset); + Db::commit(); + } catch (\Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); } - model('AuthGroupAccess')->saveAll($dataset); $this->success(); } - $this->error(); + $this->error(__('Parameter %s can not be empty', '')); } return $this->view->fetch(); } @@ -168,46 +176,53 @@ class Admin extends Backend $this->token(); $params = $this->request->post("row/a"); if ($params) { - if ($params['password']) { - if (!Validate::is($params['password'], '\S{6,16}')) { - $this->error(__("Please input correct password")); + Db::startTrans(); + try { + if ($params['password']) { + if (!Validate::is($params['password'], '\S{6,16}')) { + exception(__("Please input correct password")); + } + $params['salt'] = Random::alnum(); + $params['password'] = md5(md5($params['password']) . $params['salt']); + } else { + unset($params['password'], $params['salt']); + } + //这里需要针对username和email做唯一验证 + $adminValidate = \think\Loader::validate('Admin'); + $adminValidate->rule([ + 'username' => 'require|regex:\w{3,12}|unique:admin,username,' . $row->id, + 'email' => 'require|email|unique:admin,email,' . $row->id, + 'password' => 'regex:\S{32}', + ]); + $result = $row->validate('Admin.edit')->save($params); + if ($result === false) { + exception($row->getError()); } - $params['salt'] = Random::alnum(); - $params['password'] = md5(md5($params['password']) . $params['salt']); - } else { - unset($params['password'], $params['salt']); - } - //这里需要针对username和email做唯一验证 - $adminValidate = \think\Loader::validate('Admin'); - $adminValidate->rule([ - 'username' => 'require|regex:\w{3,12}|unique:admin,username,' . $row->id, - 'email' => 'require|email|unique:admin,email,' . $row->id, - 'password' => 'regex:\S{32}', - ]); - $result = $row->validate('Admin.edit')->save($params); - if ($result === false) { - $this->error($row->getError()); - } - // 先移除所有权限 - model('AuthGroupAccess')->where('uid', $row->id)->delete(); + // 先移除所有权限 + model('AuthGroupAccess')->where('uid', $row->id)->delete(); - $group = $this->request->post("group/a"); + $group = $this->request->post("group/a"); - // 过滤不允许的组别,避免越权 - $group = array_intersect($this->childrenGroupIds, $group); - if (!$group) { - $this->error(__('The parent group exceeds permission limit')); - } + // 过滤不允许的组别,避免越权 + $group = array_intersect($this->childrenGroupIds, $group); + if (!$group) { + exception(__('The parent group exceeds permission limit')); + } - $dataset = []; - foreach ($group as $value) { - $dataset[] = ['uid' => $row->id, 'group_id' => $value]; + $dataset = []; + foreach ($group as $value) { + $dataset[] = ['uid' => $row->id, 'group_id' => $value]; + } + model('AuthGroupAccess')->saveAll($dataset); + Db::commit(); + } catch (\Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); } - model('AuthGroupAccess')->saveAll($dataset); $this->success(); } - $this->error(); + $this->error(__('Parameter %s can not be empty', '')); } $grouplist = $this->auth->getGroups($row['id']); $groupids = []; @@ -242,10 +257,18 @@ class Admin extends Backend } $deleteIds = array_values(array_diff($deleteIds, [$this->auth->id])); if ($deleteIds) { - $this->model->destroy($deleteIds); - model('AuthGroupAccess')->where('uid', 'in', $deleteIds)->delete(); + Db::startTrans(); + try { + $this->model->destroy($deleteIds); + model('AuthGroupAccess')->where('uid', 'in', $deleteIds)->delete(); + Db::commit(); + } catch (\Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } $this->success(); } + $this->error(__('No rows were deleted')); } } $this->error(__('You have no permission')); diff --git a/application/admin/controller/auth/Rule.php b/application/admin/controller/auth/Rule.php index 80f234253c6ad2c942842b0a3a80f4ad0c762103..9ca60c021bd8ce1d0b6e648618644d563a585250 100644 --- a/application/admin/controller/auth/Rule.php +++ b/application/admin/controller/auth/Rule.php @@ -31,7 +31,7 @@ class Rule extends Backend } $this->model = model('AuthRule'); // 必须将结果集转换为数组 - $ruleList = collection($this->model->field('condition,remark,createtime,updatetime', true)->order('weigh DESC,id ASC')->select())->toArray(); + $ruleList = \think\Db::name("auth_rule")->field('type,condition,remark,createtime,updatetime', true)->order('weigh DESC,id ASC')->select(); foreach ($ruleList as $k => &$v) { $v['title'] = __($v['title']); } @@ -44,9 +44,11 @@ class Rule extends Backend continue; } $ruledata[$v['id']] = $v['title']; + unset($v['spacer']); } unset($v); $this->view->assign('ruledata', $ruledata); + $this->view->assign("menutypeList", $this->model->getMenutypeList()); } /** @@ -57,7 +59,6 @@ class Rule extends Backend if ($this->request->isAjax()) { $list = $this->rulelist; $total = count($this->rulelist); - $result = array("total" => $total, "rows" => $list); return json($result); diff --git a/application/admin/lang/zh-cn/auth/rule.php b/application/admin/lang/zh-cn/auth/rule.php index 765f378443df95fe76f8af0b4f4134d7ec927b70..053d11df7c862045063d5a7132ccba420b0514cc 100644 --- a/application/admin/lang/zh-cn/auth/rule.php +++ b/application/admin/lang/zh-cn/auth/rule.php @@ -9,11 +9,18 @@ return [ 'Name' => '规则', 'Controller/Action' => '控制器名/方法名', 'Ismenu' => '菜单', + 'Menutype' => '菜单类型', + 'Addtabs' => '选项卡(默认)', + 'Dialog' => '弹窗', + 'Ajax' => 'Ajax请求', + 'Blank' => '链接', + 'Extend' => '扩展属性', 'Search icon' => '搜索图标', 'Toggle menu visible' => '点击切换菜单显示', 'Toggle sub menu' => '点击切换子菜单', 'Menu tips' => '父级菜单无需匹配控制器和方法,子级菜单请使用控制器名', 'Node tips' => '控制器/方法名,如果有目录请使用 目录名/控制器名/方法名', + 'Url tips' => '一般情况下留空即可,如果是外部链接或相对链接请输入', 'The non-menu rule must have parent' => '非菜单规则节点必须有父级', 'Can not change the parent to child' => '父级不能是它的子级', 'Can not change the parent to self' => '父级不能是它自己', diff --git a/application/admin/lang/zh-cn/dashboard.php b/application/admin/lang/zh-cn/dashboard.php index 0008f0796cd4ca1d214400635183fb985936cd67..0b244d19e8b2b762df570204ff1cdf8f787bac4d 100644 --- a/application/admin/lang/zh-cn/dashboard.php +++ b/application/admin/lang/zh-cn/dashboard.php @@ -6,34 +6,34 @@ return [ 'Type' => '栏目类型', 'Image' => '图片', 'Total user' => '总会员数', - 'Total view' => '总访问数', - 'Total order' => '总订单数', - 'Total order amount' => '总金额', + 'Total addon' => '总插件数', + 'Total category' => '总分类数', + 'Total admin' => '总管理员数', 'Today user signup' => '今日注册', 'Today user login' => '今日登录', 'Today order' => '今日订单', 'Unsettle order' => '未处理订单', + 'Three dnu' => '三日新增', 'Seven dnu' => '七日新增', 'Seven dau' => '七日活跃', + 'Thirty dau' => '月活跃', 'Custom zone' => '这里是你的自定义数据', - 'Sales' => '成交数', - 'Orders' => '订单数', + 'Register user' => '注册用户数', 'Real time' => '实时', 'Category count' => '分类统计', 'Category count tips' => '当前分类总记录数', + 'Database count' => '数据库统计', + 'Database table nums' => '数据表数量', + 'Database size' => '占用空间', 'Attachment count' => '附件统计', + 'Attachment nums' => '附件数量', + 'Attachment size' => '附件大小', 'Attachment count tips' => '当前上传的附件数量', - 'Article count' => '文章统计', - 'News count' => '新闻统计', - 'Comment count' => '评论次数', - 'Like count' => '点赞次数', - 'Recent news' => '最新新闻', - 'Recent discussion' => '最新发贴', + 'Picture count' => '图片统计', + 'Picture nums' => '图片数量', + 'Picture size' => '图片大小', 'Server info' => '服务器信息', 'PHP version' => 'PHP版本', - 'Fastadmin version' => '主框架版本', - 'Fastadmin addon version' => '插件版本', - 'Thinkphp version' => 'ThinkPHP版本', 'Sapi name' => '运行方式', 'Debug mode' => '调试模式', 'Software' => '环境信息', diff --git a/application/admin/lang/zh-cn/general/config.php b/application/admin/lang/zh-cn/general/config.php index 14ed8b5c2c0dee309c48bd3705552f643f17937a..021384f3b6603d890bda3f0242c4eecf4d7da1f1 100644 --- a/application/admin/lang/zh-cn/general/config.php +++ b/application/admin/lang/zh-cn/general/config.php @@ -70,8 +70,8 @@ return [ 'Name already exist' => '变量名称已经存在', 'Add new config' => '点击添加新的配置', 'Send a test message' => '发送测试邮件', - 'This is a test mail content' => '这是一封来自{sitename}校验邮件,用于校验邮件配置是否正常!', - 'This is a test mail' => '这是一封来自{sitename}的邮件', + 'This is a test mail content' => '这是一封来自%s的校验邮件,用于校验邮件配置是否正常!', + 'This is a test mail' => '这是一封来自%s的邮件', 'Please input your email' => '请输入测试接收者邮箱', 'Please input correct email' => '请输入正确的邮箱地址', ]; diff --git a/application/admin/library/Auth.php b/application/admin/library/Auth.php index 00463714dd5083c0e7e0f65ff274c561552e2f5e..5e265f5cc14ba296a80c75055045006e3f355b52 100644 --- a/application/admin/library/Auth.php +++ b/application/admin/library/Auth.php @@ -432,13 +432,16 @@ class Auth extends \fast\Auth continue; } $v['icon'] = $v['icon'] . ' fa-fw'; - $v['url'] = '/' . $module . '/' . $v['name']; + $v['url'] = isset($v['url']) && $v['url'] ? $v['url'] : '/' . $module . '/' . $v['name']; $v['badge'] = isset($badgeList[$v['name']]) ? $badgeList[$v['name']] : ''; $v['py'] = $pinyin->abbr($v['title'], ''); $v['pinyin'] = $pinyin->permalink($v['title'], ''); $v['title'] = __($v['title']); + $v['url'] = preg_match("/^((?:[a-z]+:)?\/\/|data:image\/)(.*)/i", $v['url']) ? $v['url'] : url($v['url']); + $v['menuclass'] = in_array($v['menutype'], ['dialog', 'ajax']) ? 'btn-' . $v['menutype'] : ''; + $v['menutabs'] = !$v['menutype'] || in_array($v['menutype'], ['default', 'addtabs']) ? 'addtabs="' . $v['id'] . '"' : ''; $selected = $v['name'] == $fixedPage ? $v : $selected; - $referer = url($v['url']) == $refererUrl ? $v : $referer; + $referer = $v['url'] == $refererUrl ? $v : $referer; } $lastArr = array_diff($pidArr, array_filter(array_unique(array_map(function ($item) { return $item['pid']; @@ -451,8 +454,6 @@ class Auth extends \fast\Auth if ($selected == $referer) { $referer = []; } - $selected && $selected['url'] = url($selected['url']); - $referer && $referer['url'] = url($referer['url']); $select_id = $selected ? $selected['id'] : 0; $menu = $nav = ''; @@ -472,21 +473,21 @@ class Auth extends \fast\Auth foreach ($topList as $index => $item) { $childList = Tree::instance()->getTreeMenu( $item['id'], - '
  • @title @caret @badge @childlist
  • ', + '
  • @title @caret @badge @childlist
  • ', $select_id, '', 'ul', 'class="treeview-menu"' ); $current = in_array($item['id'], $selectParentIds); - $url = $childList ? 'javascript:;' : url($item['url']); + $url = $childList ? 'javascript:;' : $item['url']; $addtabs = $childList || !$url ? "" : (stripos($url, "?") !== false ? "&" : "?") . "ref=addtabs"; $childList = str_replace( '" pid="' . $item['id'] . '"', ' ' . ($current ? '' : 'hidden') . '" pid="' . $item['id'] . '"', $childList ); - $nav .= '
  • ' . $item['title'] . '
  • '; + $nav .= '
  • ' . $item['title'] . '
  • '; $menu .= $childList; } } else { @@ -494,7 +495,7 @@ class Auth extends \fast\Auth Tree::instance()->init($ruleList); $menu = Tree::instance()->getTreeMenu( 0, - '
  • @title @caret @badge @childlist
  • ', + '
  • @title @caret @badge @childlist
  • ', $select_id, '', 'ul', diff --git a/application/admin/model/AuthRule.php b/application/admin/model/AuthRule.php index 198b9f0d16c41df669aedfaf70941c0cf92634e7..236cb638302d808e98f5ae613a53ad76ab89c337 100644 --- a/application/admin/model/AuthRule.php +++ b/application/admin/model/AuthRule.php @@ -26,4 +26,9 @@ class AuthRule extends Model return __($value); } + public function getMenutypeList() + { + return ['addtabs' => __('Addtabs'), 'dialog' => __('Dialog'), 'ajax' => __('Ajax'), 'blank' => __('Blank')]; + } + } diff --git a/application/admin/view/addon/config.html b/application/admin/view/addon/config.html index ebec7b2a17e7aaf831cbdd3b4902150ec7c35eca..ca91c775e4ea4800305411b4c3474499a0ada024 100644 --- a/application/admin/view/addon/config.html +++ b/application/admin/view/addon/config.html @@ -68,20 +68,27 @@ {/case} {case value="image" break="0"}{/case} {case value="images"} -
    - - - - +
    + +
    + + +
    +
    + {/case} {case value="file" break="0"}{/case} {case value="files"} -
    - - - +
    + +
    + + +
    +
    + {/case} {case bool} diff --git a/application/admin/view/auth/rule/add.html b/application/admin/view/auth/rule/add.html index 4a9d7373be023fc49eafb8157fac7a9f66f33101..b5a5c790e86e5457edbebc5645335b37f652dd4b 100644 --- a/application/admin/view/auth/rule/add.html +++ b/application/admin/view/auth/rule/add.html @@ -24,6 +24,12 @@
    +
    + +
    + +
    +
    @@ -45,6 +51,18 @@
    +
    + +
    + {:build_radios('row[menutype]', $menutypeList)} +
    +
    +
    + +
    + +
    +
    @@ -65,4 +83,4 @@
    -{include file="auth/rule/tpl" /} \ No newline at end of file +{include file="auth/rule/tpl" /} diff --git a/application/admin/view/auth/rule/edit.html b/application/admin/view/auth/rule/edit.html index ba12a20cefb6786777714a582f08a4fcadd2d381..64ecd7238b9992b6fbb71b79d7e57ca09ea1d680 100644 --- a/application/admin/view/auth/rule/edit.html +++ b/application/admin/view/auth/rule/edit.html @@ -24,6 +24,12 @@ +
    + +
    + +
    +
    @@ -45,6 +51,18 @@
    +
    + +
    + {:build_radios('row[menutype]', $menutypeList, $row['menutype'])} +
    +
    +
    + +
    + +
    +
    @@ -65,4 +83,4 @@
    -{include file="auth/rule/tpl" /} \ No newline at end of file +{include file="auth/rule/tpl" /} diff --git a/application/admin/view/common/header.html b/application/admin/view/common/header.html index 2835a8074952e253792d4c6b59256ef892c4a6ca..a0ca7d66bb1df3daa94abf04ed976fa13eb26f8a 100755 --- a/application/admin/view/common/header.html +++ b/application/admin/view/common/header.html @@ -24,21 +24,21 @@
    -
    +
    {$todayuserlogin}
    {:__('Today user login')}
    @@ -239,40 +238,40 @@
    -
    +
    -
    {$todayorder}
    -
    {:__('Today order')}
    +
    {$threednu}
    +
    {:__('Three dnu')}
    -
    -
    +
    +
    -
    {$unsettleorder}
    -
    {:__('Unsettle order')}
    +
    {$sevendnu}
    +
    {:__('Seven dnu')}
    -
    +
    -
    {$sevendnu}
    -
    {:__('Seven dnu')}
    +
    {$sevendau}
    +
    {:__('Seven dau')}
    -
    -
    +
    +
    -
    {$sevendau}
    -
    {:__('Seven dau')}
    +
    {$thirtydau}
    +
    {:__('Thirty dau')}
    @@ -296,9 +295,14 @@
    {:__('Category count')}
    -

    1234

    -
    1234
    - {:__('Category count tips')} +
    +
    +

    {$totalcategory}

    +
    + {:__('Category count tips')} +
    +
    +
    @@ -308,12 +312,23 @@
    {:__('Real time')} -
    {:__('Attachment count')}
    +
    {:__('Database count')}
    -

    1043

    -
    2592
    - {:__('Attachment count tips')} +
    +
    +

    {$dbtablenums}

    +
    + {:__('Database table nums')} +
    +
    +
    +

    {$dbsize|format_bytes=###,'',0}

    +
    + {:__('Database size')} +
    +
    +
    @@ -324,21 +339,21 @@
    {:__('Real time')} -
    {:__('Article count')}
    +
    {:__('Attachment count')}
    -

    1234

    -
    - {:__('Comment count')} +

    {$attachmentnums}

    +
    + {:__('Attachment nums')}
    -

    6754

    -
    - {:__('Like count')} +

    {$attachmentsize|format_bytes=###,'',0}

    +
    + {:__('Attachment size')}
    @@ -351,21 +366,21 @@
    {:__('Real time')} -
    {:__('News count')}
    +
    {:__('Picture count')}
    -

    5302

    -
    - {:__('Comment count')} +

    {$picturenums}

    +
    + {:__('Picture nums')}
    -

    8205

    -
    - {:__('Like count')} +

    {$picturesize|format_bytes=###,'',0}

    +
    + {:__('Picture size')}
    @@ -385,12 +400,3 @@
    - - - diff --git a/application/admin/view/index/login.html b/application/admin/view/index/login.html index 9c10db8d78aa17d444b3c6da58b7eb4419a9f37e..80910bf4423826ed58eb87590fb6a4eb639fb4c3 100644 --- a/application/admin/view/index/login.html +++ b/application/admin/view/index/login.html @@ -113,7 +113,7 @@ {if $Think.config.fastadmin.login_captcha}
    - + diff --git a/application/common.php b/application/common.php index 43b53a30d00478abc37d71619c3e5c03536ed6b4..67bf8e02fb968164af5f24df970da69695fe829e 100755 --- a/application/common.php +++ b/application/common.php @@ -33,15 +33,16 @@ if (!function_exists('format_bytes')) { * 将字节转换为可读文本 * @param int $size 大小 * @param string $delimiter 分隔符 + * @param int $precision 小数位数 * @return string */ - function format_bytes($size, $delimiter = '') + function format_bytes($size, $delimiter = '', $precision = 2) { $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB'); for ($i = 0; $size >= 1024 && $i < 6; $i++) { $size /= 1024; } - return round($size, 2) . $delimiter . $units[$i]; + return round($size, $precision) . $delimiter . $units[$i]; } } diff --git a/application/common/library/Email.php b/application/common/library/Email.php index 8d186fc35e22e4753c3be8c2fa7389ba51b826f7..7636d761db6d51b92dadf63c3c0e8f4ce779b40e 100644 --- a/application/common/library/Email.php +++ b/application/common/library/Email.php @@ -62,7 +62,8 @@ class Email $secureArr = [0 => '', 1 => 'tls', 2 => 'ssl']; $secure = isset($secureArr[$this->options['mail_verify_type']]) ? $secureArr[$this->options['mail_verify_type']] : ''; - $this->mail = new Mailer(); + $logger = isset($this->options['debug']) && $this->options['debug'] ? new Log : null; + $this->mail = new Mailer($logger); $this->mail->setServer($this->options['mail_smtp_host'], $this->options['mail_smtp_port'], $secure); $this->mail->setAuth($this->options['mail_from'], $this->options['mail_smtp_pass']); @@ -96,10 +97,9 @@ class Email /** * 设置收件人 * @param mixed $email 收件人,多个收件人以,进行分隔 - * @param string $name 收件人名称 * @return $this */ - public function to($email, $name = '') + public function to($email) { $emailArr = $this->buildAddress($email); foreach ($emailArr as $address => $name) { @@ -176,7 +176,12 @@ class Email */ protected function buildAddress($emails) { - $emails = is_array($emails) ? $emails : array_flip(explode(',', str_replace(";", ",", $emails))); + if (!is_array($emails)) { + $emails = array_flip(explode(',', str_replace(";", ",", $emails))); + foreach ($emails as $key => $value) { + $emails[$key] = strstr($key, '@', true); + } + } return $emails; } diff --git a/application/common/library/Log.php b/application/common/library/Log.php new file mode 100644 index 0000000000000000000000000000000000000000..a9d891dca4fab40eee3781eb3ccc1471def333e9 --- /dev/null +++ b/application/common/library/Log.php @@ -0,0 +1,29 @@ +handler = \think\Db::name($this->options['table']); } + $time = time(); + $tokentime = cache('tokentime'); + if (!$tokentime || $tokentime < $time - 86400) { + cache('tokentime', $time); + $this->handler->where('expiretime', '<', $time)->where('expiretime', '>', 0)->delete(); + } } /** * 存储Token - * @param string $token Token - * @param int $user_id 会员ID - * @param int $expire 过期时长,0表示无限,单位秒 + * @param string $token Token + * @param int $user_id 会员ID + * @param int $expire 过期时长,0表示无限,单位秒 * @return bool */ public function set($token, $user_id, $expire = null) @@ -50,12 +56,12 @@ class Mysql extends Driver $expiretime = !is_null($expire) && $expire !== 0 ? time() + $expire : 0; $token = $this->getEncryptedToken($token); $this->handler->insert(['token' => $token, 'user_id' => $user_id, 'createtime' => time(), 'expiretime' => $expiretime]); - return TRUE; + return true; } /** * 获取Token内的信息 - * @param string $token + * @param string $token * @return array */ public function get($token) @@ -77,8 +83,8 @@ class Mysql extends Driver /** * 判断Token是否可用 - * @param string $token Token - * @param int $user_id 会员ID + * @param string $token Token + * @param int $user_id 会员ID * @return boolean */ public function check($token, $user_id) @@ -89,7 +95,7 @@ class Mysql extends Driver /** * 删除Token - * @param string $token + * @param string $token * @return boolean */ public function delete($token) @@ -100,7 +106,7 @@ class Mysql extends Driver /** * 删除指定用户的所有Token - * @param int $user_id + * @param int $user_id * @return boolean */ public function clear($user_id) diff --git a/application/index/view/index/index.html b/application/index/view/index/index.html index 31f96d2086ed2e54cc8c28b577fe22cf9d356c2b..bef9626fb4402f5feca95eeef967dac5c6e84ddc 100755 --- a/application/index/view/index/index.html +++ b/application/index/view/index/index.html @@ -74,7 +74,7 @@
    -

    Copyright @ 2017~{:date('Y',time())} 版权所有 {$site.beian}

    +

    Copyright @ 2017~{:date('Y',time())} 版权所有 {$site.beian}

    diff --git a/application/index/view/layout/default.html b/application/index/view/layout/default.html index 3e6ccca00d77662fb5939d0839bb75990473e107..48e87caf360fffdda47d2fd81943e17412c340b9 100644 --- a/application/index/view/layout/default.html +++ b/application/index/view/layout/default.html @@ -52,11 +52,11 @@ {include file="common/script" /} - \ No newline at end of file + diff --git a/composer.json b/composer.json index 73eef9c1ddd00be13d40745a48a2ec8d8c1f5fff..1de5b560b8d650c28d5ad78a24620169f67dfed3 100755 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ ], "require": { "php": ">=7.1.0", - "topthink/framework": "~5.0.24", + "topthink/framework": "dev-master", "topthink/think-captcha": "^1.0", "karsonzhang/fastadmin-addons": "~1.2.4", "overtrue/pinyin": "~3.0", @@ -30,5 +30,11 @@ }, "config": { "preferred-install": "dist" - } + }, + "repositories": [ + { + "type": "vcs", + "url": "https://gitee.com/karson/framework" + } + ] } diff --git a/extend/fast/Date.php b/extend/fast/Date.php index d8f7ab467a9b69a6184ec5efe7fc52a2341e013a..c4e4c31260c66c9fd79b98045ff6bf10aedd4867 100644 --- a/extend/fast/Date.php +++ b/extend/fast/Date.php @@ -25,9 +25,9 @@ class Date * [!!] A list of time zones that PHP supports can be found at * . * - * @param string $remote timezone that to find the offset of - * @param string $local timezone used as the baseline - * @param mixed $now UNIX timestamp or date string + * @param string $remote timezone that to find the offset of + * @param string $local timezone used as the baseline + * @param mixed $now UNIX timestamp or date string * @return integer */ public static function offset($remote, $local = null, $now = null) @@ -57,9 +57,9 @@ class Date * $span = self::span(60, 182, 'minutes,seconds'); // array('minutes' => 2, 'seconds' => 2) * $span = self::span(60, 182, 'minutes'); // 2 * - * @param int $remote timestamp to find the span of - * @param int $local timestamp to use as the baseline - * @param string $output formatting string + * @param int $remote timestamp to find the span of + * @param int $local timestamp to use as the baseline + * @param string $output formatting string * @return string when only a single output is requested * @return array associative list of all outputs requested * @from https://github.com/kohana/ohanzee-helpers/blob/master/src/Date.php @@ -117,8 +117,8 @@ class Date /** * 格式化 UNIX 时间戳为人易读的字符串 * - * @param int Unix 时间戳 - * @param mixed $local 本地时间 + * @param int Unix 时间戳 + * @param mixed $local 本地时间 * * @return string 格式化的日期字符串 */ @@ -167,6 +167,8 @@ class Date $minute = is_null($minute) ? date('i') : $minute; $position = in_array($position, array('begin', 'start', 'first', 'front')); + $baseTime = mktime(0, 0, 0, $month, $day, $year); + switch ($type) { case 'minute': $time = $position ? mktime($hour, $minute + $offset, 0, $month, $day, $year) : mktime($hour, $minute + $offset, 59, $month, $day, $year); @@ -178,19 +180,20 @@ class Date $time = $position ? mktime(0, 0, 0, $month, $day + $offset, $year) : mktime(23, 59, 59, $month, $day + $offset, $year); break; case 'week': + $weekIndex = date("w", $baseTime); $time = $position ? - mktime(0, 0, 0, $month, $day - date("w", mktime(0, 0, 0, $month, $day, $year)) + 1 - 7 * (-$offset), $year) : - mktime(23, 59, 59, $month, $day - date("w", mktime(0, 0, 0, $month, $day, $year)) + 7 - 7 * (-$offset), $year); + strtotime($offset . " weeks", strtotime(date('Y-m-d', strtotime("-" . ($weekIndex ? $weekIndex - 1 : 6) . " days", $baseTime)))) : + strtotime($offset . " weeks", strtotime(date('Y-m-d 23:59:59', strtotime("+" . (6 - ($weekIndex ? $weekIndex - 1 : 6)) . " days", $baseTime)))); break; case 'month': - $_timestamp=mktime(0, 0, 0, $month + $offset, 1, $year); - $time = $position ? $_timestamp : mktime(23, 59, 59, $month + $offset, cal_days_in_month(CAL_GREGORIAN, date("m",$_timestamp), date("Y",$_timestamp)), $year); + $_timestamp = mktime(0, 0, 0, $month + $offset, 1, $year); + $time = $position ? $_timestamp : mktime(23, 59, 59, $month + $offset, cal_days_in_month(CAL_GREGORIAN, date("m", $_timestamp), date("Y", $_timestamp)), $year); break; case 'quarter': - $_month=date("m",mktime(0, 0, 0, (ceil(date('n', mktime(0, 0, 0, $month, $day, $year)) / 3) + $offset) * 3, $day, $year)); + $_month = date("m", mktime(0, 0, 0, (ceil(date('n', mktime(0, 0, 0, $month, $day, $year)) / 3) + $offset) * 3, $day, $year)); $time = $position ? - mktime(0, 0, 0, 1 + ((ceil(date('n', mktime(0, 0, 0, $month, $day, $year)) / 3) + $offset) - 1) * 3, 1, $year) : - mktime(23, 59, 59, (ceil(date('n', mktime(0, 0, 0, $month, $day, $year)) / 3) + $offset) * 3, cal_days_in_month(CAL_GREGORIAN, $_month, $year), $year); + mktime(0, 0, 0, 1 + ((ceil(date('n', $baseTime) / 3) + $offset) - 1) * 3, 1, $year) : + mktime(23, 59, 59, (ceil(date('n', $baseTime) / 3) + $offset) * 3, cal_days_in_month(CAL_GREGORIAN, (ceil(date('n', $baseTime) / 3) + $offset) * 3, $year), $year); break; case 'year': $time = $position ? mktime(0, 0, 0, 1, 1, $year + $offset) : mktime(23, 59, 59, 12, 31, $year + $offset); diff --git a/extend/fast/Pinyin.php b/extend/fast/Pinyin.php index 87606535f82fd2c9e5c625086e33735e920b74e9..7397c4fc2d15481c6ae8b3a248498ee7168c155b 100644 --- a/extend/fast/Pinyin.php +++ b/extend/fast/Pinyin.php @@ -7,79 +7,30 @@ namespace fast; */ class Pinyin { - protected static $keys = "a|ai|an|ang|ao|ba|bai|ban|bang|bao|bei|ben|beng|bi|bian|biao|bie|bin|bing|bo|bu|ca|cai|can|cang|cao|ce|ceng|cha|chai|chan|chang|chao|che|chen|cheng|chi|chong|chou|chu|chuai|chuan|chuang|chui|chun|chuo|ci|cong|cou|cu|cuan|cui|cun|cuo|da|dai|dan|dang|dao|de|deng|di|dian|diao|die|ding|diu|dong|dou|du|duan|dui|dun|duo|e|en|er|fa|fan|fang|fei|fen|feng|fo|fou|fu|ga|gai|gan|gang|gao|ge|gei|gen|geng|gong|gou|gu|gua|guai|guan|guang|gui|gun|guo|ha|hai|han|hang|hao|he|hei|hen|heng|hong|hou|hu|hua|huai|huan|huang|hui|hun|huo|ji|jia|jian|jiang|jiao|jie|jin|jing|jiong|jiu|ju|juan|jue|jun|ka|kai|kan|kang|kao|ke|ken|keng|kong|kou|ku|kua|kuai|kuan|kuang|kui|kun|kuo|la|lai|lan|lang|lao|le|lei|leng|li|lia|lian|liang|liao|lie|lin|ling|liu|long|lou|lu|lv|luan|lue|lun|luo|ma|mai|man|mang|mao|me|mei|men|meng|mi|mian|miao|mie|min|ming|miu|mo|mou|mu|na|nai|nan|nang|nao|ne|nei|nen|neng|ni|nian|niang|niao|nie|nin|ning|niu|nong|nu|nv|nuan|nue|nuo|o|ou|pa|pai|pan|pang|pao|pei|pen|peng|pi|pian|piao|pie|pin|ping|po|pu|qi|qia|qian|qiang|qiao|qie|qin|qing|qiong|qiu|qu|quan|que|qun|ran|rang|rao|re|ren|reng|ri|rong|rou|ru|ruan|rui|run|ruo|sa|sai|san|sang|sao|se|sen|seng|sha|shai|shan|shang|shao|she|shen|sheng|shi|shou|shu|shua|shuai|shuan|shuang|shui|shun|shuo|si|song|sou|su|suan|sui|sun|suo|ta|tai|tan|tang|tao|te|teng|ti|tian|tiao|tie|ting|tong|tou|tu|tuan|tui|tun|tuo|wa|wai|wan|wang|wei|wen|weng|wo|wu|xi|xia|xian|xiang|xiao|xie|xin|xing|xiong|xiu|xu|xuan|xue|xun|ya|yan|yang|yao|ye|yi|yin|ying|yo|yong|you|yu|yuan|yue|yun|za|zai|zan|zang|zao|ze|zei|zen|zeng|zha|zhai|zhan|zhang|zhao|zhe|zhen|zheng|zhi|zhong|zhou|zhu|zhua|zhuai|zhuan|zhuang|zhui|zhun|zhuo|zi|zong|zou|zu|zuan|zui|zun|zuo"; - protected static $values = "-20319|-20317|-20304|-20295|-20292|-20283|-20265|-20257|-20242|-20230|-20051|-20036|-20032|-20026|-20002|-19990|-19986|-19982|-19976|-19805|-19784|-19775|-19774|-19763|-19756|-19751|-19746|-19741|-19739|-19728|-19725|-19715|-19540|-19531|-19525|-19515|-19500|-19484|-19479|-19467|-19289|-19288|-19281|-19275|-19270|-19263|-19261|-19249|-19243|-19242|-19238|-19235|-19227|-19224|-19218|-19212|-19038|-19023|-19018|-19006|-19003|-18996|-18977|-18961|-18952|-18783|-18774|-18773|-18763|-18756|-18741|-18735|-18731|-18722|-18710|-18697|-18696|-18526|-18518|-18501|-18490|-18478|-18463|-18448|-18447|-18446|-18239|-18237|-18231|-18220|-18211|-18201|-18184|-18183|-18181|-18012|-17997|-17988|-17970|-17964|-17961|-17950|-17947|-17931|-17928|-17922|-17759|-17752|-17733|-17730|-17721|-17703|-17701|-17697|-17692|-17683|-17676|-17496|-17487|-17482|-17468|-17454|-17433|-17427|-17417|-17202|-17185|-16983|-16970|-16942|-16915|-16733|-16708|-16706|-16689|-16664|-16657|-16647|-16474|-16470|-16465|-16459|-16452|-16448|-16433|-16429|-16427|-16423|-16419|-16412|-16407|-16403|-16401|-16393|-16220|-16216|-16212|-16205|-16202|-16187|-16180|-16171|-16169|-16158|-16155|-15959|-15958|-15944|-15933|-15920|-15915|-15903|-15889|-15878|-15707|-15701|-15681|-15667|-15661|-15659|-15652|-15640|-15631|-15625|-15454|-15448|-15436|-15435|-15419|-15416|-15408|-15394|-15385|-15377|-15375|-15369|-15363|-15362|-15183|-15180|-15165|-15158|-15153|-15150|-15149|-15144|-15143|-15141|-15140|-15139|-15128|-15121|-15119|-15117|-15110|-15109|-14941|-14937|-14933|-14930|-14929|-14928|-14926|-14922|-14921|-14914|-14908|-14902|-14894|-14889|-14882|-14873|-14871|-14857|-14678|-14674|-14670|-14668|-14663|-14654|-14645|-14630|-14594|-14429|-14407|-14399|-14384|-14379|-14368|-14355|-14353|-14345|-14170|-14159|-14151|-14149|-14145|-14140|-14137|-14135|-14125|-14123|-14122|-14112|-14109|-14099|-14097|-14094|-14092|-14090|-14087|-14083|-13917|-13914|-13910|-13907|-13906|-13905|-13896|-13894|-13878|-13870|-13859|-13847|-13831|-13658|-13611|-13601|-13406|-13404|-13400|-13398|-13395|-13391|-13387|-13383|-13367|-13359|-13356|-13343|-13340|-13329|-13326|-13318|-13147|-13138|-13120|-13107|-13096|-13095|-13091|-13076|-13068|-13063|-13060|-12888|-12875|-12871|-12860|-12858|-12852|-12849|-12838|-12831|-12829|-12812|-12802|-12607|-12597|-12594|-12585|-12556|-12359|-12346|-12320|-12300|-12120|-12099|-12089|-12074|-12067|-12058|-12039|-11867|-11861|-11847|-11831|-11798|-11781|-11604|-11589|-11536|-11358|-11340|-11339|-11324|-11303|-11097|-11077|-11067|-11055|-11052|-11045|-11041|-11038|-11024|-11020|-11019|-11018|-11014|-10838|-10832|-10815|-10800|-10790|-10780|-10764|-10587|-10544|-10533|-10519|-10331|-10329|-10328|-10322|-10315|-10309|-10307|-10296|-10281|-10274|-10270|-10262|-10260|-10256|-10254"; /** * 获取文字的拼音 * @param string $chinese 中文汉字 * @param boolean $onlyfirst 是否只返回拼音首字母 * @param string $delimiter 分隔符 - * @param string $charset 文字编码 + * @param bool $ucfirst 是否首字母大写 * @return string */ - public static function get($chinese, $onlyfirst = false, $delimiter = '', $ucfirst = false, $charset = 'utf-8') + public static function get($chinese, $onlyfirst = false, $delimiter = '', $ucfirst = false) { - $keys_a = explode('|', self::$keys); - $values_a = explode('|', self::$values); - $data = array_combine($keys_a, $values_a); - arsort($data); - reset($data); - if ($charset != 'gb2312') { - $chinese = self::_u2_utf8_gb($chinese); - } - $result = ''; - for ($i = 0; $i < strlen($chinese); $i++) { - $_P = ord(substr($chinese, $i, 1)); - if ($_P > 160) { - $_Q = ord(substr($chinese, ++$i, 1)); - $_P = $_P * 256 + $_Q - 65536; - } - $result .= ($onlyfirst ? substr(self::_pinyin($_P, $data), 0, 1) : self::_pinyin($_P, $data)); - $result .= $delimiter; - } - if ($delimiter) { - $result = rtrim($result, $delimiter); - } - return preg_replace("/[^a-z0-9_\-]*/i", '', $result); - } - - private static function _pinyin($num, $data) - { - if ($num > 0 && $num < 160) { - return chr($num); - } elseif ($num < -20319 || $num > -10247) { - return ''; + $pinyin = new \Overtrue\Pinyin\Pinyin(); + if ($onlyfirst) { + $result = $pinyin->abbr($chinese, $delimiter); } else { - foreach ($data as $k => $v) { - if ($v <= $num) { - break; - } - } - - return $k; + $result = $pinyin->permalink($chinese, $delimiter); } - } - - private static function _u2_utf8_gb($c) - { - $string = ''; - if ($c < 0x80) { - $string .= $c; - } elseif ($c < 0x800) { - $string .= chr(0xC0 | $c >> 6); - $string .= chr(0x80 | $c & 0x3F); - } elseif ($c < 0x10000) { - $string .= chr(0xE0 | $c >> 12); - $string .= chr(0x80 | $c >> 6 & 0x3F); - $string .= chr(0x80 | $c & 0x3F); - } elseif ($c < 0x200000) { - $string .= chr(0xF0 | $c >> 18); - $string .= chr(0x80 | $c >> 12 & 0x3F); - $string .= chr(0x80 | $c >> 6 & 0x3F); - $string .= chr(0x80 | $c & 0x3F); + if ($ucfirst) { + $pinyinArr = explode($delimiter, $result); + $result = implode($delimiter, array_map('ucfirst', $pinyinArr)); } - return iconv('UTF-8', 'GB2312//IGNORE', $string); + + return $result; } + } diff --git a/extend/fast/Tree.php b/extend/fast/Tree.php index f874d0594280f1a1da74e56d49bfe403bb9e50de..52f1cbb25851145aac0691cce3e392420d608f27 100644 --- a/extend/fast/Tree.php +++ b/extend/fast/Tree.php @@ -322,7 +322,7 @@ class Tree $childlist = strtr($childlist, array('@class' => $childdata ? 'last' : '')); $value = array( '@childlist' => $childlist, - '@url' => $childdata || !isset($value['@url']) ? "javascript:;" : url($value['@url']), + '@url' => $childdata || !isset($value['@url']) ? "javascript:;" : $value['@url'], '@addtabs' => $childdata || !isset($value['@url']) ? "" : (stripos($value['@url'], "?") !== false ? "&" : "?") . "ref=addtabs", '@caret' => ($childdata && (!isset($value['@badge']) || !$value['@badge']) ? '' : ''), '@badge' => isset($value['@badge']) ? $value['@badge'] : '', diff --git a/public/assets/js/backend/auth/rule.js b/public/assets/js/backend/auth/rule.js index 7da8840ccea6e452fc823369278f38332ca81394..de86f7ec41bac2ab2ea548c272506489f021d62a 100755 --- a/public/assets/js/backend/auth/rule.js +++ b/public/assets/js/backend/auth/rule.js @@ -55,58 +55,67 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function pagination: false, search: false, commonSearch: false, + rowAttributes: function (row, index) { + if (this.totalRows > 500) { + return row.pid == 0 ? {} : {style: "display:none"}; + } + return row.haschild == 1 || row.ismenu == 1 ? {} : {style: "display:none"}; + } }); // 为表格绑定事件 Table.api.bindevent(table); + var btnSuccessEvent = function (data, ret) { + if ($(this).hasClass("btn-change")) { + var index = $(this).data("index"); + var row = Table.api.getrowbyindex(table, index); + row.ismenu = $("i.fa.text-gray", this).length > 0 ? 1 : 0; + table.bootstrapTable("updateRow", {index: index, row: row}); + } else if ($(this).hasClass("btn-delone")) { + if ($(this).closest("tr[data-index]").find("a.btn-node-sub.disabled").length > 0) { + $(this).closest("tr[data-index]").remove(); + } else { + table.bootstrapTable('refresh'); + } + } else if ($(this).hasClass("btn-dragsort")) { + table.bootstrapTable('refresh'); + } + Fast.api.refreshmenu(); + return false; + }; + //表格内容渲染前 table.on('pre-body.bs.table', function (e, data) { var options = table.bootstrapTable("getOptions"); options.escape = true; }); + //当内容渲染完成后 table.on('post-body.bs.table', function (e, data) { var options = table.bootstrapTable("getOptions"); options.escape = false; - //默认隐藏所有子节点 - //$("a.btn[data-id][data-pid][data-pid!=0]").closest("tr").hide(); - $(".btn-node-sub.disabled").closest("tr").hide(); - //显示隐藏子节点 - $(".btn-node-sub").off("click").on("click", function (e) { - var status = $(this).data("shown") ? true : false; - $("a.btn[data-pid='" + $(this).data("id") + "']").each(function () { - $(this).closest("tr").toggle(!status); - }); - $(this).data("shown", !status); - return false; - }); //点击切换/排序/删除操作后刷新左侧菜单 - $(".btn-change[data-id],.btn-delone,.btn-dragsort").data("success", function (data, ret) { - if ($(this).hasClass("btn-change")) { - var index = $(this).data("index"); - var row = Table.api.getrowbyindex(table, index); - row.ismenu = $("i.fa.text-gray", this).length > 0 ? 1 : 0; - table.bootstrapTable("updateRow", {index: index, row: row}); - } else if ($(this).hasClass("btn-delone")) { - if ($(this).closest("tr[data-index]").find("a.btn-node-sub.disabled").length > 0) { - $(this).closest("tr[data-index]").remove(); - } else { - table.bootstrapTable('refresh'); - } - } else if ($(this).hasClass("btn-dragsort")) { - table.bootstrapTable('refresh'); - } - Fast.api.refreshmenu(); - return false; - }); + $(".btn-change[data-id],.btn-delone,.btn-dragsort").data("success", btnSuccessEvent); }); + + //显示隐藏子节点 + $(document).on("click", ".btn-node-sub", function (e) { + var status = $(this).data("shown") ? true : false; + $("a.btn[data-pid='" + $(this).data("id") + "']").each(function () { + $(this).closest("tr").toggle(!status); + }); + $(this).data("shown", !status); + return false; + }); + //批量删除后的回调 $(".toolbar > .btn-del,.toolbar .btn-more~ul>li>a").data("success", function (e) { Fast.api.refreshmenu(); }); + //展开隐藏一级 $(document.body).on("click", ".btn-toggle", function (e) { $("a.btn[data-id][data-pid][data-pid!=0].disabled").closest("tr").hide(); @@ -117,6 +126,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function $("a.btn[data-id][data-pid][data-pid!=0]").not('.disabled').closest("tr").toggle(show); $(".btn-node-sub[data-pid=0]").data("shown", show); }); + //展开隐藏全部 $(document.body).on("click", ".btn-toggle-all", function (e) { var that = this; @@ -153,7 +163,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function bindevent: function () { $(document).on('click', "input[name='row[ismenu]']", function () { var name = $("input[name='row[name]']"); - name.prop("placeholder", $(this).val() == 1 ? name.data("placeholder-menu") : name.data("placeholder-node")); + var ismenu = $(this).val() == 1; + name.prop("placeholder", ismenu ? name.data("placeholder-menu") : name.data("placeholder-node")); + $('div[data-type="menu"]').toggleClass("hidden", !ismenu); }); $("input[name='row[ismenu]']:checked").trigger("click"); diff --git a/public/assets/js/backend/dashboard.js b/public/assets/js/backend/dashboard.js index 078d1def3cb9f2b87fb29230c89e1de172c9398f..ab8409c2eba7640d900850454a10989d80654ac6 100755 --- a/public/assets/js/backend/dashboard.js +++ b/public/assets/js/backend/dashboard.js @@ -11,11 +11,19 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echart text: '', subtext: '' }, + color: [ + "#18d1b1", + "#3fb1e3", + "#626c91", + "#a0a7e6", + "#c4ebad", + "#96dee8" + ], tooltip: { trigger: 'axis' }, legend: { - data: [__('Sales'), __('Orders')] + data: [__('Register user')] }, toolbox: { show: false, @@ -27,7 +35,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echart xAxis: { type: 'category', boundaryGap: false, - data: Orderdata.column + data: Config.column }, yAxis: {}, grid: [{ @@ -37,7 +45,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echart bottom: 30 }], series: [{ - name: __('Sales'), + name: __('Register user'), type: 'line', smooth: true, areaStyle: { @@ -48,55 +56,13 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echart width: 1.5 } }, - data: Orderdata.paydata - }, - { - name: __('Orders'), - type: 'line', - smooth: true, - areaStyle: { - normal: {} - }, - lineStyle: { - normal: { - width: 1.5 - } - }, - data: Orderdata.createdata - }] + data: Config.userdata + }] }; // 使用刚指定的配置项和数据显示图表。 myChart.setOption(option); - //动态添加数据,可以通过Ajax获取数据然后填充 - setInterval(function () { - Orderdata.column.push((new Date()).toLocaleTimeString().replace(/^\D*/, '')); - var amount = Math.floor(Math.random() * 200) + 20; - Orderdata.createdata.push(amount); - Orderdata.paydata.push(Math.floor(Math.random() * amount) + 1); - - //按自己需求可以取消这个限制 - if (Orderdata.column.length >= 20) { - //移除最开始的一条数据 - Orderdata.column.shift(); - Orderdata.paydata.shift(); - Orderdata.createdata.shift(); - } - myChart.setOption({ - xAxis: { - data: Orderdata.column - }, - series: [{ - name: __('Sales'), - data: Orderdata.paydata - }, - { - name: __('Orders'), - data: Orderdata.createdata - }] - }); - }, 2000); $(window).resize(function () { myChart.resize(); }); diff --git a/public/assets/js/backend/index.js b/public/assets/js/backend/index.js index 7171576ae828535e0e64c0386e58047ce88e0d72..464d41b0e1dc7a414bf21453b1675c2871fd6158 100755 --- a/public/assets/js/backend/index.js +++ b/public/assets/js/backend/index.js @@ -73,7 +73,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi }); //清除缓存 - $(document).on('click', "ul.wipecache li a", function () { + $(document).on('click', "ul.wipecache li a,a.wipecache", function () { $.ajax({ url: 'ajax/wipecache', dataType: 'json',