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'], - '