From fce5b8e3747a2f9b2e89d7f60423745b97991684 Mon Sep 17 00:00:00 2001 From: Karson Date: Wed, 1 Dec 2021 16:35:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=87=AA=E5=8A=A8=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=A0=87=E7=AD=BE&=E6=97=B6=E9=97=B4=E5=8C=BA?= =?UTF-8?q?=E9=97=B4=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增自动生成固定列 新增弱密码检测 优化插件相关命令行命令 优化默认管理员和前台用户头像 --- application/admin/command/Addon.php | 51 +----- .../admin/command/Addon/stubs/addon.stub | 14 -- .../admin/command/Addon/stubs/info.stub | 4 +- application/admin/command/Crud.php | 163 ++++++++++++++++-- application/admin/command/Crud/stubs/add.stub | 2 +- .../admin/command/Crud/stubs/edit.stub | 2 +- .../Crud/stubs/html/fieldlist-template.stub | 20 +++ .../admin/command/Crud/stubs/javascript.stub | 4 +- application/admin/command/Install.php | 9 +- .../admin/command/Install/fastadmin.sql | 7 +- .../admin/command/Install/install.html | 8 +- application/admin/command/Install/zh-cn.php | 1 + 12 files changed, 199 insertions(+), 86 deletions(-) create mode 100644 application/admin/command/Crud/stubs/html/fieldlist-template.stub diff --git a/application/admin/command/Addon.php b/application/admin/command/Addon.php index aaba93a8..fb7c437c 100644 --- a/application/admin/command/Addon.php +++ b/application/admin/command/Addon.php @@ -21,11 +21,12 @@ class Addon extends Command $this ->setName('addon') ->addOption('name', 'a', Option::VALUE_REQUIRED, 'addon name', null) - ->addOption('action', 'c', Option::VALUE_REQUIRED, 'action(create/enable/disable/install/uninstall/refresh/upgrade/package/move)', 'create') + ->addOption('action', 'c', Option::VALUE_REQUIRED, 'action(create/enable/disable/uninstall/refresh/package/move)', 'create') ->addOption('force', 'f', Option::VALUE_OPTIONAL, 'force override', null) ->addOption('release', 'r', Option::VALUE_OPTIONAL, 'addon release version', null) ->addOption('uid', 'u', Option::VALUE_OPTIONAL, 'fastadmin uid', null) ->addOption('token', 't', Option::VALUE_OPTIONAL, 'fastadmin token', null) + ->addOption('domain', 'd', Option::VALUE_OPTIONAL, 'domain', null) ->addOption('local', 'l', Option::VALUE_OPTIONAL, 'local package', null) ->setDescription('Addon manager'); } @@ -48,7 +49,7 @@ class Addon extends Command include dirname(__DIR__) . DS . 'common.php'; - if (!$name) { + if (!$name && !in_array($action, ['refresh'])) { throw new Exception('Addon name could not be empty'); } if (!$action || !in_array($action, ['create', 'disable', 'enable', 'install', 'uninstall', 'refresh', 'upgrade', 'package', 'move'])) { @@ -132,42 +133,6 @@ class Addon extends Command } $output->info(ucfirst($action) . " Successed!"); break; - case 'install': - //非覆盖模式时如果存在则报错 - if (is_dir($addonDir) && !$force) { - throw new Exception("addon already exists!\nIf you need to install again, use the parameter --force=true "); - } - //如果存在先移除 - if (is_dir($addonDir)) { - rmdirs($addonDir); - } - // 获取本地路径 - $local = $input->getOption('local'); - try { - Service::install($name, 0, ['version' => $release], $local); - } catch (AddonException $e) { - if ($e->getCode() != -3) { - throw new Exception($e->getMessage()); - } - if (!$force) { - //如果有冲突文件则提醒 - $data = $e->getData(); - foreach ($data['conflictlist'] as $k => $v) { - $output->warning($v); - } - $output->info("Are you sure you want to override all those files? Type 'yes' to continue: "); - $line = fgets(defined('STDIN') ? STDIN : fopen('php://stdin', 'r')); - if (trim($line) != 'yes') { - throw new Exception("Operation is aborted!"); - } - } - Service::install($name, 1, ['version' => $release, 'uid' => $uid, 'token' => $token], $local); - } catch (Exception $e) { - throw new Exception($e->getMessage()); - } - - $output->info("Install Successed!"); - break; case 'uninstall': //非覆盖模式时如果存在则报错 if (!$force) { @@ -202,10 +167,6 @@ class Addon extends Command Service::refresh(); $output->info("Refresh Successed!"); break; - case 'upgrade': - Service::upgrade($name, ['version' => $release, 'uid' => $uid, 'token' => $token]); - $output->info("Upgrade Successed!"); - break; case 'package': $infoFile = $addonDir . 'info.ini'; if (!is_file($infoFile)) { @@ -256,8 +217,8 @@ class Addon extends Command case 'move': $movePath = [ 'adminOnlySelfDir' => ['admin/behavior', 'admin/controller', 'admin/library', 'admin/model', 'admin/validate', 'admin/view'], - 'adminAllSubDir' => ['admin/lang'], - 'publicDir' => ['public/assets/addons', 'public/assets/js/backend'] + 'adminAllSubDir' => ['admin/lang'], + 'publicDir' => ['public/assets/addons', 'public/assets/js/backend'] ]; $paths = []; $appPath = str_replace('/', DS, APP_PATH); @@ -350,7 +311,7 @@ class Addon extends Command /** * 写入到文件 * @param string $name - * @param array $data + * @param array $data * @param string $pathname * @return mixed */ diff --git a/application/admin/command/Addon/stubs/addon.stub b/application/admin/command/Addon/stubs/addon.stub index 824e02c1..a32cb13a 100644 --- a/application/admin/command/Addon/stubs/addon.stub +++ b/application/admin/command/Addon/stubs/addon.stub @@ -51,18 +51,4 @@ class {%addonClassName%} extends Addons return true; } - /** - * 实现钩子方法 - * @return mixed - */ - public function testhook($param) - { - // 调用钩子时候的参数信息 - print_r($param); - // 当前插件的配置信息,配置信息存在当前目录的config.php文件中,见下方 - print_r($this->getConfig()); - // 可以返回模板,模板文件默认读取的为插件目录中的文件。模板名不能为空! - //return $this->fetch('view/info'); - } - } diff --git a/application/admin/command/Addon/stubs/info.stub b/application/admin/command/Addon/stubs/info.stub index a6a3496f..1c4e3047 100644 --- a/application/admin/command/Addon/stubs/info.stub +++ b/application/admin/command/Addon/stubs/info.stub @@ -1,7 +1,7 @@ name = {%name%} title = 插件名称{%name%} -intro = FastAdmin插件 +intro = 插件介绍 author = yourname website = https://www.fastadmin.net version = 1.0.0 -state = 1 \ No newline at end of file +state = 1 diff --git a/application/admin/command/Crud.php b/application/admin/command/Crud.php index c707aff9..1de41069 100755 --- a/application/admin/command/Crud.php +++ b/application/admin/command/Crud.php @@ -19,16 +19,91 @@ class Crud extends Command protected $stubList = []; protected $internalKeywords = [ - 'abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 'class', 'clone', 'const', 'continue', 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final', 'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'isset', 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected', 'public', 'require', 'require_once', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', 'while', 'xor' + 'abstract', + 'and', + 'array', + 'as', + 'break', + 'callable', + 'case', + 'catch', + 'class', + 'clone', + 'const', + 'continue', + 'declare', + 'default', + 'die', + 'do', + 'echo', + 'else', + 'elseif', + 'empty', + 'enddeclare', + 'endfor', + 'endforeach', + 'endif', + 'endswitch', + 'endwhile', + 'eval', + 'exit', + 'extends', + 'final', + 'for', + 'foreach', + 'function', + 'global', + 'goto', + 'if', + 'implements', + 'include', + 'include_once', + 'instanceof', + 'insteadof', + 'interface', + 'isset', + 'list', + 'namespace', + 'new', + 'or', + 'print', + 'private', + 'protected', + 'public', + 'require', + 'require_once', + 'return', + 'static', + 'switch', + 'throw', + 'trait', + 'try', + 'unset', + 'use', + 'var', + 'while', + 'xor' ]; /** * 受保护的系统表, crud不会生效 */ protected $systemTables = [ - 'admin', 'admin_log', 'auth_group', 'auth_group_access', 'auth_rule', - 'attachment', 'config', 'category', 'ems', 'sms', - 'user', 'user_group', 'user_rule', 'user_score_log', 'user_token', + 'admin', + 'admin_log', + 'auth_group', + 'auth_group_access', + 'auth_rule', + 'attachment', + 'config', + 'category', + 'ems', + 'sms', + 'user', + 'user_group', + 'user_rule', + 'user_score_log', + 'user_token', ]; /** @@ -68,11 +143,21 @@ class Crud extends Command */ protected $citySuffix = ['city']; + /** + * 时间区间后缀 + */ + protected $rangeSuffix = ['range']; + /** * JSON后缀 */ protected $jsonSuffix = ['json']; + /** + * 标签后缀 + */ + protected $tagSuffix = ['tag', 'tags']; + /** * Selectpage对应的后缀 */ @@ -95,7 +180,9 @@ class Crud extends Command 'images' => 'images', 'avatar' => 'image', 'switch' => 'toggle', - 'time' => ['type' => ['int', 'timestamp'], 'name' => 'datetime'] + 'tag' => 'flag', + 'tags' => 'flag', + 'time' => ['type' => ['int', 'timestamp'], 'name' => 'datetime'], ]; /** @@ -183,12 +270,14 @@ 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('tagsuffix', null, Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'automatically generate tag 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) ->addOption('sortfield', null, Option::VALUE_OPTIONAL, 'sort field', null) ->addOption('headingfilterfield', null, Option::VALUE_OPTIONAL, 'heading filter field', null) + ->addOption('fixedcolumns', null, Option::VALUE_OPTIONAL, 'fixed columns', null) ->addOption('editorclass', null, Option::VALUE_OPTIONAL, 'automatically generate editor class', null) ->addOption('db', null, Option::VALUE_OPTIONAL, 'database config name', 'database') ->setDescription('Build CRUD controller and model from table'); @@ -214,12 +303,12 @@ class Crud extends Command $force = $input->getOption('force'); //是否为本地model,为0时表示为全局model将会把model放在app/common/model中 $local = $input->getOption('local'); - + if (!$table) { throw new Exception('table name can\'t empty'); } - - + + //是否生成菜单 $menu = $input->getOption("menu"); //关联表 @@ -242,10 +331,14 @@ class Crud extends Command $imagefield = $input->getOption('imagefield'); //文件后缀 $filefield = $input->getOption('filefield'); + //标签后缀 + $tagsuffix = $input->getOption('tagsuffix'); //日期后缀 $intdatesuffix = $input->getOption('intdatesuffix'); //开关后缀 $switchsuffix = $input->getOption('switchsuffix'); + //富文本编辑器 + $editorsuffix = $input->getOption('editorsuffix'); //城市后缀 $citysuffix = $input->getOption('citysuffix'); //JSON配置后缀 @@ -260,6 +353,8 @@ class Crud extends Command $sortfield = $input->getOption('sortfield'); //顶部筛选过滤字段 $headingfilterfield = $input->getOption('headingfilterfield'); + //固定列数量 + $fixedcolumns = $input->getOption('fixedcolumns'); //编辑器Class $editorclass = $input->getOption('editorclass'); if ($setcheckboxsuffix) { @@ -274,12 +369,18 @@ class Crud extends Command if ($filefield) { $this->fileField = $filefield; } + if ($tagsuffix) { + $this->tagSuffix = $tagsuffix; + } if ($intdatesuffix) { $this->intDateSuffix = $intdatesuffix; } if ($switchsuffix) { $this->switchSuffix = $switchsuffix; } + if ($editorsuffix) { + $this->editorSuffix = $editorsuffix; + } if ($citysuffix) { $this->citySuffix = $citysuffix; } @@ -312,7 +413,7 @@ class Crud extends Command $prefix = Config::get($db . '.prefix'); //系统表无法生成,防止后台错乱 - if(in_array(str_replace($prefix,"",$table),$this->systemTables)){ + if (in_array(str_replace($prefix, "", $table), $this->systemTables)) { throw new Exception('system table can\'t be crud'); } @@ -685,6 +786,14 @@ class Crud extends Command $attrArr['data-use-current'] = "true"; $formAddElement = Form::text($fieldName, $defaultDateTime, $attrArr); $formEditElement = Form::text($fieldName, ($fieldFunc ? "{:\$row.{$field}?{$fieldFunc}(\$row.{$field}):''}" : "{\$row.{$field}{$fieldFunc}}"), $attrArr); + } elseif ($inputType == 'datetimerange') { + $cssClassArr[] = 'datetimerange'; + $attrArr['class'] = implode(' ', $cssClassArr); + $attrArr['data-locale'] = '{"format":"YYYY-MM-DD HH:mm:ss"}'; + $fieldFunc = ''; + $defaultDateTime = ""; + $formAddElement = Form::text($fieldName, $defaultDateTime, $attrArr); + $formEditElement = Form::text($fieldName, $editValue, $attrArr); } elseif ($inputType == 'checkbox' || $inputType == 'radio') { unset($attrArr['data-rule']); $fieldName = $inputType == 'checkbox' ? $fieldName .= "[]" : $fieldName; @@ -728,12 +837,25 @@ class Crud extends Command $attrArr['data-toggle'] = "city-picker"; $formAddElement = sprintf("
%s
", Form::input('text', $fieldName, $defaultValue, $attrArr)); $formEditElement = sprintf("
%s
", Form::input('text', $fieldName, $editValue, $attrArr)); + } elseif ($inputType == 'tagsinput') { + $attrArr['class'] = implode(' ', $cssClassArr); + $attrArr['data-role'] = "tagsinput"; + $formAddElement = Form::input('text', $fieldName, $defaultValue, $attrArr); + $formEditElement = Form::input('text', $fieldName, $editValue, $attrArr); } elseif ($inputType == 'fieldlist') { $itemArr = $this->getItemArray($itemArr, $field, $v['COLUMN_COMMENT']); + $templateName = !isset($itemArr['key']) && !isset($itemArr['value']) && count($itemArr) > 0 ? 'fieldlist-template' : 'fieldlist'; $itemKey = isset($itemArr['key']) ? ucfirst($itemArr['key']) : 'Key'; $itemValue = isset($itemArr['value']) ? ucfirst($itemArr['value']) : 'Value'; - $formAddElement = $this->getReplacedStub('html/' . $inputType, ['field' => $field, 'fieldName' => $fieldName, 'itemKey' => $itemKey, 'itemValue' => $itemValue, 'fieldValue' => $defaultValue]); - $formEditElement = $this->getReplacedStub('html/' . $inputType, ['field' => $field, 'fieldName' => $fieldName, 'itemKey' => $itemKey, 'itemValue' => $itemValue, 'fieldValue' => $editValue]); + $theadListArr = $tbodyListArr = []; + foreach ($itemArr as $index => $item) { + $theadListArr[] = "{:__('" . $item . "')}"; + $tbodyListArr[] = ''; + } + $colspan = count($theadListArr) + 1; + $commonFields = ['field' => $field, 'fieldName' => $fieldName, 'itemKey' => $itemKey, 'itemValue' => $itemValue, 'theadList' => implode("\n", $theadListArr), 'tbodyList' => implode("\n", $tbodyListArr), 'colspan' => $colspan]; + $formAddElement = $this->getReplacedStub('html/' . $templateName, array_merge($commonFields, ['fieldValue' => $defaultValue])); + $formEditElement = $this->getReplacedStub('html/' . $templateName, array_merge($commonFields, ['fieldValue' => $editValue])); } else { $search = $replace = ''; //特殊字段为关联搜索 @@ -858,6 +980,12 @@ class Crud extends Command } unset($line); $langList = implode(",\n", array_filter($langList)); + $fixedcolumns = count($columnList) >= 10 ? 1 : $fixedcolumns; + + $fixedColumnsJs = ''; + if (is_numeric($fixedcolumns) && $fixedcolumns) { + $fixedColumnsJs = "\n" . str_repeat(" ", 16) . "fixedColumns: true,\n" . str_repeat(" ", 16) . ($fixedcolumns < 0 ? "fixedNumber" : "fixedRightNumber") . ": " . $fixedcolumns . ","; + } //表注释 $tableComment = $modelTableInfo['Comment']; @@ -885,6 +1013,7 @@ class Crud extends Command 'iconName' => $iconName, 'pk' => $priKey, 'order' => $order, + 'fixedColumnsJs' => $fixedColumnsJs, 'table' => $table, 'tableName' => $modelTableName, 'addList' => $addList, @@ -904,7 +1033,7 @@ class Crud extends Command 'recyclebinJs' => '', 'headingHtml' => $headingHtml, 'recyclebinHtml' => $recyclebinHtml, - 'visibleFieldList' => $fields ? "\$row->visible(['" . implode("','", array_filter(in_array($priKey,explode(',', $fields))?explode(',', $fields):explode(',',$priKey.','.$fields))) . "']);" : '', + 'visibleFieldList' => $fields ? "\$row->visible(['" . implode("','", array_filter(in_array($priKey, explode(',', $fields)) ? explode(',', $fields) : explode(',', $priKey . ',' . $fields))) . "']);" : '', 'appendAttrList' => implode(",\n", $appendAttrList), 'getEnumList' => implode("\n\n", $getEnumArr), 'getAttrList' => implode("\n\n", $getAttrArr), @@ -963,7 +1092,7 @@ class Crud extends Command if ($relations) { foreach ($relations as $i => $relation) { - $relation['modelNamespace'] = $data['modelNamespace']; + $relation['modelNamespace'] = $relation['relationNamespace']; if (!is_file($relation['relationFile'])) { // 生成关联模型文件 $this->writeToFile('relationmodel', $relation, $relation['relationFile']); @@ -1360,10 +1489,18 @@ EOD; if ($this->isMatchSuffix($fieldsName, $this->citySuffix) && ($v['DATA_TYPE'] == 'varchar' || $v['DATA_TYPE'] == 'char')) { $inputType = "citypicker"; } + // 指定后缀结尾城市选择框 + if ($this->isMatchSuffix($fieldsName, $this->rangeSuffix) && ($v['DATA_TYPE'] == 'varchar' || $v['DATA_TYPE'] == 'char')) { + $inputType = "datetimerange"; + } // 指定后缀结尾JSON配置 if ($this->isMatchSuffix($fieldsName, $this->jsonSuffix) && ($v['DATA_TYPE'] == 'varchar' || $v['DATA_TYPE'] == 'text')) { $inputType = "fieldlist"; } + // 指定后缀结尾标签配置 + if ($this->isMatchSuffix($fieldsName, $this->tagSuffix) && ($v['DATA_TYPE'] == 'varchar' || $v['DATA_TYPE'] == 'text')) { + $inputType = "tagsinput"; + } return $inputType; } diff --git a/application/admin/command/Crud/stubs/add.stub b/application/admin/command/Crud/stubs/add.stub index 68d6de24..e51cf203 100644 --- a/application/admin/command/Crud/stubs/add.stub +++ b/application/admin/command/Crud/stubs/add.stub @@ -4,7 +4,7 @@ diff --git a/application/admin/command/Crud/stubs/edit.stub b/application/admin/command/Crud/stubs/edit.stub index 1a6f297c..1c05f20e 100644 --- a/application/admin/command/Crud/stubs/edit.stub +++ b/application/admin/command/Crud/stubs/edit.stub @@ -4,7 +4,7 @@ diff --git a/application/admin/command/Crud/stubs/html/fieldlist-template.stub b/application/admin/command/Crud/stubs/html/fieldlist-template.stub new file mode 100644 index 00000000..5881caca --- /dev/null +++ b/application/admin/command/Crud/stubs/html/fieldlist-template.stub @@ -0,0 +1,20 @@ + + + + {%theadList%} + + + +
{:__('Operate')}
+ {:__('Append')} + +
+ diff --git a/application/admin/command/Crud/stubs/javascript.stub b/application/admin/command/Crud/stubs/javascript.stub index 4774dffa..31b2b0d2 100644 --- a/application/admin/command/Crud/stubs/javascript.stub +++ b/application/admin/command/Crud/stubs/javascript.stub @@ -21,7 +21,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: '{%pk%}', - sortName: '{%order%}', + sortName: '{%order%}',{%fixedColumnsJs%} columns: [ [ {%javascriptList%} @@ -45,4 +45,4 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin } }; return Controller; -}); \ No newline at end of file +}); diff --git a/application/admin/command/Install.php b/application/admin/command/Install.php index 99414c39..1bef9614 100644 --- a/application/admin/command/Install.php +++ b/application/admin/command/Install.php @@ -162,6 +162,10 @@ class Install extends Command if (!preg_match("/^[\S]{6,16}$/", $adminPassword)) { throw new Exception(__('Please input correct password')); } + $weakPasswordArr = ['123456', '12345678', '123456789', '654321', '111111', '000000', 'password', 'qwerty', 'abc123', '1qaz2wsx']; + if (in_array($adminPassword, $weakPasswordArr)) { + throw new Exception(__('Password is too weak')); + } if ($siteName == '' || preg_match("/fast" . "admin/i", $siteName)) { throw new Exception(__('Please input correct website')); } @@ -230,18 +234,19 @@ class Install extends Command throw new Exception(__('The current permissions are insufficient to write the file %s', 'application/config.php')); } + $avatar = request()->domain() . '/assets/img/avatar.png'; // 变更默认管理员密码 $adminPassword = $adminPassword ? $adminPassword : Random::alnum(8); $adminEmail = $adminEmail ? $adminEmail : "admin@admin.com"; $newSalt = substr(md5(uniqid(true)), 0, 6); $newPassword = md5(md5($adminPassword) . $newSalt); - $data = ['username' => $adminUsername, 'email' => $adminEmail, 'password' => $newPassword, 'salt' => $newSalt]; + $data = ['username' => $adminUsername, 'email' => $adminEmail, 'avatar' => $avatar, 'password' => $newPassword, 'salt' => $newSalt]; $instance->name('admin')->where('username', 'admin')->update($data); // 变更前台默认用户的密码,随机生成 $newSalt = substr(md5(uniqid(true)), 0, 6); $newPassword = md5(md5(Random::alnum(8)) . $newSalt); - $instance->name('user')->where('username', 'admin')->update(['password' => $newPassword, 'salt' => $newSalt]); + $instance->name('user')->where('username', 'admin')->update(['avatar' => $avatar, 'password' => $newPassword, 'salt' => $newSalt]); // 修改后台入口 $adminName = ''; diff --git a/application/admin/command/Install/fastadmin.sql b/application/admin/command/Install/fastadmin.sql index 775e2027..e4b6a214 100755 --- a/application/admin/command/Install/fastadmin.sql +++ b/application/admin/command/Install/fastadmin.sql @@ -45,7 +45,7 @@ CREATE TABLE `fa_admin_log` ( `username` varchar(30) DEFAULT '' COMMENT '管理员名字', `url` varchar(1500) DEFAULT '' COMMENT '操作页面', `title` varchar(100) DEFAULT '' COMMENT '日志标题', - `content` text NOT NULL COMMENT '内容', + `content` longtext NOT NULL COMMENT '内容', `ip` varchar(50) DEFAULT '' COMMENT 'IP', `useragent` varchar(255) DEFAULT '' COMMENT 'User-Agent', `createtime` int(10) DEFAULT NULL COMMENT '操作时间', @@ -395,6 +395,7 @@ CREATE TABLE `fa_test` ( `admin_id` int(10) DEFAULT '0' COMMENT '管理员ID', `category_id` int(10) unsigned DEFAULT '0' COMMENT '分类ID(单选)', `category_ids` varchar(100) COMMENT '分类ID(多选)', + `tags` varchar(255) DEFAULT '' COMMENT '标签', `week` enum('monday','tuesday','wednesday') COMMENT '星期(单选):monday=星期一,tuesday=星期二,wednesday=星期三', `flag` set('hot','index','recommend') DEFAULT '' COMMENT '标志(多选):hot=热门,index=首页,recommend=推荐', `genderdata` enum('male','female') DEFAULT 'male' COMMENT '性别(单选):male=男,female=女', @@ -408,8 +409,10 @@ CREATE TABLE `fa_test` ( `description` varchar(255) DEFAULT '' COMMENT '描述', `city` varchar(100) DEFAULT '' COMMENT '省市', `json` varchar(255) DEFAULT NULL COMMENT '配置:key=名称,value=值', + `multiplejson` varchar(1500) DEFAULT '' COMMENT '二维数组:title=标题,intro=介绍,author=作者,age=年龄', `price` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '价格', `views` int(10) unsigned DEFAULT '0' COMMENT '点击', + `workrange` varchar(100) DEFAULT '' COMMENT '时间区间', `startdate` date DEFAULT NULL COMMENT '开始日期', `activitytime` datetime DEFAULT NULL COMMENT '活动时间(datetime)', `year` year(4) DEFAULT NULL COMMENT '年', @@ -429,7 +432,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', 1491635035, 1491635035, 1491635035, 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\"}', '[{\"title\":\"标题一\",\"intro\":\"介绍一\",\"author\":\"小明\",\"age\":\"21\"}]', 0.00, 0, '2020-10-01 00:00:00 - 2021-10-31 23:59:59', '2017-07-10', '2017-07-10 18:24:45', 2017, '18:24:45', 1491635035, 1491635035, 1491635035, NULL, 0, 1, 'normal', '1'); COMMIT; -- ---------------------------- diff --git a/application/admin/command/Install/install.html b/application/admin/command/Install/install.html index 6c982eaa..1381c80d 100644 --- a/application/admin/command/Install/install.html +++ b/application/admin/command/Install/install.html @@ -31,7 +31,7 @@ } a { - color: #18bc9c; + color: #4e73df; text-decoration: none; } @@ -81,7 +81,7 @@ } .form-field input:focus { - border-color: #18bc9c; + border-color: #4e73df; background: #fff; color: #444; outline: none; @@ -165,7 +165,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink"> @@ -287,7 +287,7 @@ if (typeof data.adminName !== 'undefined') { var url = location.href.replace(/install\.php/, data.adminName); $("#warmtips").html("{:__('Security tips')}" + '' + url + '').show(); - $('' + "{:__('Dashboard')}" + '').appendTo($buttons); + $('' + "{:__('Dashboard')}" + '').appendTo($buttons); } localStorage.setItem("fastep", "installed"); } else { diff --git a/application/admin/command/Install/zh-cn.php b/application/admin/command/Install/zh-cn.php index a7dc331a..d2e4a110 100644 --- a/application/admin/command/Install/zh-cn.php +++ b/application/admin/command/Install/zh-cn.php @@ -24,6 +24,7 @@ return [ 'Please input correct database' => '请输入正确的数据库名', 'Please input correct username' => '用户名只能由3-12位数字、字母、下划线组合', 'Please input correct password' => '密码长度必须在6-16位之间,不能包含空格', + 'Password is too weak' => '密码太简单,请重新输入', 'The two passwords you entered did not match' => '两次输入的密码不一致', 'Please input correct website' => '网站名称输入不正确', 'The current version %s is too low, please use PHP 7.1 or higher' => '当前版本%s过低,请使用PHP7.1以上版本',