mirror of https://gitee.com/karson/fastadmin.git
Merge branch 'develop' of gitee.com:karson/fastadmin into develop
commit
4b1c3a3b4b
|
|
@ -21,6 +21,16 @@ class Crud extends Command
|
||||||
protected $internalKeywords = [
|
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',
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Selectpage搜索字段关联
|
* Selectpage搜索字段关联
|
||||||
*/
|
*/
|
||||||
|
|
@ -204,9 +214,12 @@ class Crud extends Command
|
||||||
$force = $input->getOption('force');
|
$force = $input->getOption('force');
|
||||||
//是否为本地model,为0时表示为全局model将会把model放在app/common/model中
|
//是否为本地model,为0时表示为全局model将会把model放在app/common/model中
|
||||||
$local = $input->getOption('local');
|
$local = $input->getOption('local');
|
||||||
|
|
||||||
if (!$table) {
|
if (!$table) {
|
||||||
throw new Exception('table name can\'t empty');
|
throw new Exception('table name can\'t empty');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//是否生成菜单
|
//是否生成菜单
|
||||||
$menu = $input->getOption("menu");
|
$menu = $input->getOption("menu");
|
||||||
//关联表
|
//关联表
|
||||||
|
|
@ -298,6 +311,11 @@ class Crud extends Command
|
||||||
$dbname = Config::get($db . '.database');
|
$dbname = Config::get($db . '.database');
|
||||||
$prefix = Config::get($db . '.prefix');
|
$prefix = Config::get($db . '.prefix');
|
||||||
|
|
||||||
|
//系统表无法生成,防止后台错乱
|
||||||
|
if(in_array(str_replace($prefix,"",$table),$this->systemTables)){
|
||||||
|
throw new Exception('system table can\'t be crud');
|
||||||
|
}
|
||||||
|
|
||||||
//模块
|
//模块
|
||||||
$moduleName = 'admin';
|
$moduleName = 'admin';
|
||||||
$modelModuleName = $local ? $moduleName : 'common';
|
$modelModuleName = $local ? $moduleName : 'common';
|
||||||
|
|
@ -886,7 +904,7 @@ class Crud extends Command
|
||||||
'recyclebinJs' => '',
|
'recyclebinJs' => '',
|
||||||
'headingHtml' => $headingHtml,
|
'headingHtml' => $headingHtml,
|
||||||
'recyclebinHtml' => $recyclebinHtml,
|
'recyclebinHtml' => $recyclebinHtml,
|
||||||
'visibleFieldList' => $fields ? "\$row->visible(['" . implode("','", array_filter(explode(',', $fields))) . "']);" : '',
|
'visibleFieldList' => $fields ? "\$row->visible(['" . implode("','", array_filter(in_array($priKey,explode(',', $fields))?explode(',', $fields):explode(',',$priKey.','.$fields))) . "']);" : '',
|
||||||
'appendAttrList' => implode(",\n", $appendAttrList),
|
'appendAttrList' => implode(",\n", $appendAttrList),
|
||||||
'getEnumList' => implode("\n\n", $getEnumArr),
|
'getEnumList' => implode("\n\n", $getEnumArr),
|
||||||
'getAttrList' => implode("\n\n", $getAttrArr),
|
'getAttrList' => implode("\n\n", $getAttrArr),
|
||||||
|
|
|
||||||
|
|
@ -473,7 +473,7 @@ class Auth extends \fast\Auth
|
||||||
foreach ($topList as $index => $item) {
|
foreach ($topList as $index => $item) {
|
||||||
$childList = Tree::instance()->getTreeMenu(
|
$childList = Tree::instance()->getTreeMenu(
|
||||||
$item['id'],
|
$item['id'],
|
||||||
'<li class="@class" pid="@pid"><a @extend href="@url@addtabs" addtabs="@id" class="@menuclass" url="@url" py="@py" pinyin="@pinyin" title="@title"><i class="@icon"></i> <span>@title</span> <span class="pull-right-container">@caret @badge</span></a> @childlist</li>',
|
'<li class="@class" pid="@pid"><a @extend href="@url@addtabs" addtabs="@id" class="@menuclass" url="@url" py="@py" pinyin="@pinyin"><i class="@icon"></i> <span>@title</span> <span class="pull-right-container">@caret @badge</span></a> @childlist</li>',
|
||||||
$select_id,
|
$select_id,
|
||||||
'',
|
'',
|
||||||
'ul',
|
'ul',
|
||||||
|
|
@ -495,7 +495,7 @@ class Auth extends \fast\Auth
|
||||||
Tree::instance()->init($ruleList);
|
Tree::instance()->init($ruleList);
|
||||||
$menu = Tree::instance()->getTreeMenu(
|
$menu = Tree::instance()->getTreeMenu(
|
||||||
0,
|
0,
|
||||||
'<li class="@class"><a @extend href="@url@addtabs" @menutabs class="@menuclass" url="@url" py="@py" pinyin="@pinyin" title="@title"><i class="@icon"></i> <span>@title</span> <span class="pull-right-container">@caret @badge</span></a> @childlist</li>',
|
'<li class="@class"><a @extend href="@url@addtabs" @menutabs class="@menuclass" url="@url" py="@py" pinyin="@pinyin"><i class="@icon"></i> <span>@title</span> <span class="pull-right-container">@caret @badge</span></a> @childlist</li>',
|
||||||
$select_id,
|
$select_id,
|
||||||
'',
|
'',
|
||||||
'ul',
|
'ul',
|
||||||
|
|
|
||||||
|
|
@ -219,6 +219,7 @@ class Email
|
||||||
preg_match_all("/Expected: (\d+)\, Got: (\d+)( \| (.*))?\$/i", $e->getMessage(), $matches);
|
preg_match_all("/Expected: (\d+)\, Got: (\d+)( \| (.*))?\$/i", $e->getMessage(), $matches);
|
||||||
$code = isset($matches[2][3]) ? $matches[2][3] : 0;
|
$code = isset($matches[2][3]) ? $matches[2][3] : 0;
|
||||||
$message = isset($matches[2][0]) ? $matches[4][0] : $e->getMessage();
|
$message = isset($matches[2][0]) ? $matches[4][0] : $e->getMessage();
|
||||||
|
$message = mb_convert_encoding($message, 'UTF-8', 'GBK,GB2312,BIG5');
|
||||||
$this->setError($message);
|
$this->setError($message);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->setError($e->getMessage());
|
$this->setError($e->getMessage());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue