diff --git a/application/admin/command/Crud.php b/application/admin/command/Crud.php index 670ea405..14ace38b 100755 --- a/application/admin/command/Crud.php +++ b/application/admin/command/Crud.php @@ -58,6 +58,11 @@ class Crud extends Command */ protected $citySuffix = ['city']; + /** + * JSON后缀 + */ + protected $jsonSuffix = ['json']; + /** * Selectpage对应的后缀 */ @@ -167,6 +172,7 @@ class Crud extends Command ->addOption('intdatesuffix', null, Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'automatically generate date component with suffix', null) ->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('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) @@ -228,6 +234,8 @@ class Crud extends Command $switchsuffix = $input->getOption('switchsuffix'); //城市后缀 $citysuffix = $input->getOption('citysuffix'); + //JSON配置后缀 + $jsonsuffix = $input->getOption('jsonsuffix'); //selectpage后缀 $selectpagesuffix = $input->getOption('selectpagesuffix'); //selectpage多选后缀 @@ -261,6 +269,9 @@ class Crud extends Command if ($citysuffix) { $this->citySuffix = $citysuffix; } + if ($jsonsuffix) { + $this->jsonSuffix = $jsonsuffix; + } if ($selectpagesuffix) { $this->selectpageSuffix = $selectpagesuffix; } @@ -581,7 +592,7 @@ class Crud extends Command $cssClassArr = ['form-control']; $fieldName = "row[{$field}]"; $defaultValue = $v['COLUMN_DEFAULT']; - $editValue = "{\$row.{$field}}"; + $editValue = "{\$row.{$field}|htmlentities}"; // 如果默认值非null,则是一个必选项 if ($v['IS_NULLABLE'] == 'NO') { $attrArr['data-rule'] = 'required'; @@ -688,6 +699,12 @@ class Crud extends Command $attrArr['data-toggle'] = "city-picker"; $formAddElement = sprintf("
我是测试内容
', '/assets/img/avatar.png', '/assets/img/avatar.png,/assets/img/qrcode.png', '/assets/img/avatar.png', '关键字', '描述', '广西壮族自治区/百色市/平果县', 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', 1499682285, 1499682526, 1499682526, NULL, 0, 1, 'normal', '1'); COMMIT; -- ---------------------------- diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php index 0c17b3e9..f4f0c298 100644 --- a/application/admin/controller/Addon.php +++ b/application/admin/controller/Addon.php @@ -13,7 +13,7 @@ use think\Exception; /** * 插件管理 * - * @icon fa fa-circle-o + * @icon fa fa-cube * @remark 可在线安装、卸载、禁用、启用插件,同时支持添加本地插件。FastAdmin已上线插件商店 ,你可以发布你的免费或付费插件:https://www.fastadmin.net/store.html */ class Addon extends Backend @@ -34,6 +34,7 @@ class Addon extends Backend foreach ($addons as $k => &$v) { $config = get_addon_config($v['name']); $v['config'] = $config ? 1 : 0; + $v['url'] = str_replace($this->request->server('SCRIPT_NAME'), '', $v['url']); } $this->assignconfig(['addons' => $addons]); return $this->view->fetch(); @@ -320,6 +321,7 @@ class Addon extends Backend $v['releaselist'] = []; } $v['url'] = addon_url($v['name']); + $v['url'] = str_replace($this->request->server('SCRIPT_NAME'), '', $v['url']); $v['createtime'] = filemtime(ADDON_PATH . $v['name']); if ($filter && isset($filter['category_id']) && is_numeric($filter['category_id']) && $filter['category_id'] != $v['category_id']) { continue; diff --git a/application/admin/controller/Category.php b/application/admin/controller/Category.php index 6714343a..c2d48827 100644 --- a/application/admin/controller/Category.php +++ b/application/admin/controller/Category.php @@ -25,7 +25,6 @@ class Category extends Backend public function _initialize() { parent::_initialize(); - $this->request->filter(['strip_tags']); $this->model = model('app\common\model\Category'); $tree = Tree::instance(); @@ -47,6 +46,8 @@ class Category extends Backend */ public function index() { + //设置过滤方法 + $this->request->filter(['strip_tags']); if ($this->request->isAjax()) { $search = $this->request->request("search"); $type = $this->request->request("type"); diff --git a/application/admin/controller/user/User.php b/application/admin/controller/user/User.php index fd34f9e9..814ecd03 100644 --- a/application/admin/controller/user/User.php +++ b/application/admin/controller/user/User.php @@ -33,27 +33,24 @@ class User extends Backend { //设置过滤方法 $this->request->filter(['strip_tags']); - if ($this->request->isAjax()) - { + if ($this->request->isAjax()) { //如果发送的来源是Selectpage,则转发到Selectpage - if ($this->request->request('keyField')) - { + if ($this->request->request('keyField')) { return $this->selectpage(); } list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $total = $this->model - ->with('group') - ->where($where) - ->order($sort, $order) - ->count(); + ->with('group') + ->where($where) + ->order($sort, $order) + ->count(); $list = $this->model - ->with('group') - ->where($where) - ->order($sort, $order) - ->limit($offset, $limit) - ->select(); - foreach ($list as $k => $v) - { + ->with('group') + ->where($where) + ->order($sort, $order) + ->limit($offset, $limit) + ->select(); + foreach ($list as $k => $v) { $v->hidden(['password', 'salt']); } $result = array("total" => $total, "rows" => $list); diff --git a/application/admin/lang/zh-cn/dashboard.php b/application/admin/lang/zh-cn/dashboard.php index 321efacb..8bd0bb95 100644 --- a/application/admin/lang/zh-cn/dashboard.php +++ b/application/admin/lang/zh-cn/dashboard.php @@ -31,8 +31,9 @@ return [ 'Recent discussion' => '最新发贴', 'Server info' => '服务器信息', 'PHP version' => 'PHP版本', - 'Fastadmin version' => 'FastAdmin版本', - 'Fastadmin addon version' => 'FastAdmin插件版本', + 'Fastadmin version' => '主框架版本', + 'Fastadmin addon version' => '插件版本', + 'Thinkphp version' => 'ThinkPHP版本', 'Sapi name' => '运行方式', 'Debug mode' => '调试模式', 'Software' => '环境信息', @@ -42,5 +43,6 @@ return [ 'Cdn url' => '静态资源CDN', 'Timezone' => '时区', 'Language' => '语言', + 'View more' => '查看更多', 'Security tips' => ' 安全提示:你正在使用默认的后台登录入口,为了你的网站安全,建议你修改后台登录入口,点击查看修改方法', ]; diff --git a/application/admin/view/addon/config.html b/application/admin/view/addon/config.html index 9863101c..fd4db30e 100644 --- a/application/admin/view/addon/config.html +++ b/application/admin/view/addon/config.html @@ -21,10 +21,10 @@| {:__('FastAdmin version')} | -{$Think.config.fastadmin.version} 检查最新版 | -
| {:__('FastAdmin addon version')} | -{$addonversion} | -
| {:__('Sapi name')} | -{:php_sapi_name()} | -
| {:__('Debug mode')} | -{$Think.config.app_debug?__('Yes'):__('No')} | -
| {:__('Software')} | -{$Think.server.SERVER_SOFTWARE} | -
| {:__('Upload mode')} | -{$uploadmode} | -
| {:__('Upload url')} | -{$config.upload.uploadurl} | -
| {:__('Upload Cdn url')} | -{$config.upload.cdnurl} | -
| {:__('Timezone')} | -{:date_default_timezone_get()} | -
| {:__('Cdn url')} | -__CDN__ | -
| {:__('Language')} | -{$config.language} | -
{$admin.email}