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("
%s
", Form::input('text', $fieldName, $defaultValue, $attrArr)); $formEditElement = sprintf("
%s
", Form::input('text', $fieldName, $editValue, $attrArr)); + } elseif ($inputType == 'fieldlist') { + $itemArr = $this->getItemArray($itemArr, $field, $v['COLUMN_COMMENT']); + $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]); } else { $search = $replace = ''; //特殊字段为关联搜索 @@ -753,7 +770,7 @@ class Crud extends Command } //过滤text类型字段 - if ($v['DATA_TYPE'] != 'text') { + if ($v['DATA_TYPE'] != 'text' && $inputType != 'fieldlist') { //主键 if ($v['COLUMN_KEY'] == 'PRI' && !$priDefined) { $priDefined = true; @@ -768,7 +785,7 @@ class Crud extends Command $javascriptList[] = $this->getJsColumn($field, $v['DATA_TYPE'], $inputType && in_array($inputType, ['select', 'checkbox', 'radio']) ? '_text' : '', $itemArr); } if ($this->headingFilterField && $this->headingFilterField == $field && $itemArr) { - $headingHtml = $this->getReplacedStub('html/heading-html', ['field' => $field]); + $headingHtml = $this->getReplacedStub('html/heading-html', ['field' => $field, 'fieldName' => Loader::parseName($field, 1, false)]); } //排序方式,如果有指定排序字段,否则按主键排序 $order = $field == $this->sortField ? $this->sortField : $order; @@ -1081,9 +1098,9 @@ EOD; /** * 获取已解析相关信息 * @param string $module 模块名称 - * @param string $name 自定义名称 - * @param string $table 数据表名 - * @param string $type 解析类型,本例中为controller、model、validate + * @param string $name 自定义名称 + * @param string $table 数据表名 + * @param string $type 解析类型,本例中为controller、model、validate * @return array */ protected function getParseNameData($module, $name, $table, $type) @@ -1113,7 +1130,7 @@ EOD; /** * 写入到文件 * @param string $name - * @param array $data + * @param array $data * @param string $pathname * @return mixed */ @@ -1134,7 +1151,7 @@ EOD; /** * 获取替换后的数据 * @param string $name - * @param array $data + * @param array $data * @return string */ protected function getReplacedStub($name, $data) @@ -1199,7 +1216,7 @@ EOD; /** * 读取数据和语言数组列表 - * @param array $arr + * @param array $arr * @param boolean $withTpl * @return array */ @@ -1314,13 +1331,17 @@ EOD; if ($this->isMatchSuffix($fieldsName, $this->citySuffix) && ($v['DATA_TYPE'] == 'varchar' || $v['DATA_TYPE'] == 'char')) { $inputType = "citypicker"; } + // 指定后缀结尾JSON配置 + if ($this->isMatchSuffix($fieldsName, $this->jsonSuffix) && ($v['DATA_TYPE'] == 'varchar' || $v['DATA_TYPE'] == 'text')) { + $inputType = "fieldlist"; + } return $inputType; } /** * 判断是否符合指定后缀 - * @param string $field 字段名称 - * @param mixed $suffixArr 后缀 + * @param string $field 字段名称 + * @param mixed $suffixArr 后缀 * @return boolean */ protected function isMatchSuffix($field, $suffixArr) @@ -1387,7 +1408,7 @@ EOD; * @param string $field * @param string $datatype * @param string $extend - * @param array $itemArr + * @param array $itemArr * @return string */ protected function getJsColumn($field, $datatype = '', $extend = '', $itemArr = []) diff --git a/application/admin/command/Crud/stubs/html/fieldlist.stub b/application/admin/command/Crud/stubs/html/fieldlist.stub new file mode 100644 index 00000000..42688bba --- /dev/null +++ b/application/admin/command/Crud/stubs/html/fieldlist.stub @@ -0,0 +1,10 @@ + +
+
+ {:__('{%itemKey%}')} + {:__('{%itemValue%}')} +
+
{:__('Append')}
+ +
+ diff --git a/application/admin/command/Crud/stubs/html/heading-html.stub b/application/admin/command/Crud/stubs/html/heading-html.stub index 7972eaec..5cbf3272 100644 --- a/application/admin/command/Crud/stubs/html/heading-html.stub +++ b/application/admin/command/Crud/stubs/html/heading-html.stub @@ -3,7 +3,7 @@ {:build_heading(null,FALSE)} diff --git a/application/admin/command/Install/fastadmin.sql b/application/admin/command/Install/fastadmin.sql index 1f2f96a2..20c91b76 100755 --- a/application/admin/command/Install/fastadmin.sql +++ b/application/admin/command/Install/fastadmin.sql @@ -162,7 +162,7 @@ CREATE TABLE `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-list', '', 'Category tips', 1, 1497429920, 1497429920, 119, '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'); @@ -313,7 +313,7 @@ CREATE TABLE `fa_config` ( -- ---------------------------- BEGIN; INSERT INTO `fa_config` VALUES (1, 'name', 'basic', 'Site name', '请填写站点名称', 'string', 'FastAdmin', '', 'required', ''); -INSERT INTO `fa_config` VALUES (2, 'beian', 'basic', 'Beian', '粤ICP备15054802号-4', 'string', '', '', '', ''); +INSERT INTO `fa_config` VALUES (2, 'beian', 'basic', 'Beian', '粤ICP备15000000号-1', 'string', '', '', '', ''); INSERT INTO `fa_config` VALUES (3, 'cdnurl', 'basic', 'Cdn url', '如果静态资源使用第三方云储存请配置该值', 'string', '', '', '', ''); INSERT INTO `fa_config` VALUES (4, 'version', 'basic', 'Version', '如果静态资源有变动请重新配置该值', 'string', '1.0.1', '', 'required', ''); INSERT INTO `fa_config` VALUES (5, 'timezone', 'basic', 'Timezone', '', 'string', 'Asia/Shanghai', '', 'required', ''); @@ -382,6 +382,7 @@ CREATE TABLE `fa_test` ( `keywords` varchar(100) NOT NULL DEFAULT '' COMMENT '关键字', `description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述', `city` varchar(100) NOT NULL DEFAULT '' COMMENT '省市', + `json` varchar(255) DEFAULT NULL COMMENT '配置:key=名称,value=值', `price` float(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '价格', `views` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '点击', `startdate` date DEFAULT NULL COMMENT '开始日期', @@ -403,7 +404,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', '关键字', '描述', '广西壮族自治区/百色市/平果县', 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 @@
{switch $item.type} {case string} - + {/case} {case text} - + {/case} {case array}
@@ -33,14 +33,14 @@ {:__('Array value')}
{:__('Append')}
- +
{/case} {case datetime} - + {/case} {case number} - + {/case} {case checkbox} {foreach name="item.content" item="vo"} @@ -56,15 +56,14 @@ {case value="selects"} {/case} {case value="image" break="0"}{/case} {case value="images"}
- + @@ -73,7 +72,7 @@ {case value="file" break="0"}{/case} {case value="files"}
- +
diff --git a/application/admin/view/auth/admin/edit.html b/application/admin/view/auth/admin/edit.html index 428e9766..8629f180 100644 --- a/application/admin/view/auth/admin/edit.html +++ b/application/admin/view/auth/admin/edit.html @@ -8,19 +8,19 @@
- +
- +
- +
diff --git a/application/admin/view/auth/group/edit.html b/application/admin/view/auth/group/edit.html index 22476056..6eb9fd56 100644 --- a/application/admin/view/auth/group/edit.html +++ b/application/admin/view/auth/group/edit.html @@ -9,7 +9,7 @@
- +
diff --git a/application/admin/view/auth/rule/edit.html b/application/admin/view/auth/rule/edit.html index 966d1463..58bcff9b 100644 --- a/application/admin/view/auth/rule/edit.html +++ b/application/admin/view/auth/rule/edit.html @@ -14,13 +14,13 @@
- +
- +
@@ -41,13 +41,13 @@
- +
- +
diff --git a/application/admin/view/category/add.html b/application/admin/view/category/add.html index b0fe795c..806d9f4a 100644 --- a/application/admin/view/category/add.html +++ b/application/admin/view/category/add.html @@ -56,7 +56,7 @@
- +
diff --git a/application/admin/view/category/edit.html b/application/admin/view/category/edit.html index b4c9ed37..99b6d8cd 100644 --- a/application/admin/view/category/edit.html +++ b/application/admin/view/category/edit.html @@ -27,13 +27,13 @@
- +
- +
@@ -52,7 +52,7 @@
- +
@@ -65,13 +65,13 @@
- +
- +
diff --git a/application/admin/view/dashboard/index.html b/application/admin/view/dashboard/index.html index 5c02bdf2..e50b59d7 100644 --- a/application/admin/view/dashboard/index.html +++ b/application/admin/view/dashboard/index.html @@ -1,53 +1,62 @@ {if preg_match('/\/admin\/|admin\.php|admin_d75KABNWt\.php/i', url())} @@ -187,60 +215,60 @@
-
+
-
{$todayusersignup}
-
{:__('Today user signup')}
+
{$todayusersignup}
+
{:__('Today user signup')}
-
+
-
{$todayuserlogin}
-
{:__('Today user login')}
+
{$todayuserlogin}
+
{:__('Today user login')}
-
+
-
{$todayorder}
-
{:__('Today order')}
+
{$todayorder}
+
{:__('Today order')}
-
+
-
{$unsettleorder}
-
{:__('Unsettle order')}
+
{$unsettleorder}
+
{:__('Unsettle order')}
-
+
-
{$sevendnu}
-
{:__('Seven dnu')}
+
{$sevendnu}
+
{:__('Seven dnu')}
-
+
-
{$sevendau}
-
{:__('Seven dau')}
+
{$sevendau}
+
{:__('Seven dau')}
@@ -299,11 +327,15 @@

1234

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

6754

-
{:__('Like count')}
+
+ {:__('Like count')} +
@@ -322,11 +354,15 @@

5302

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

8205

-
{:__('Like count')}
+
+ {:__('Like count')} +
@@ -335,85 +371,118 @@
-
-
+

{:__('Recent news')}

+
-
- +
+
-

{:__('Server info')}

-
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{:__('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}
+ + {:__('FastAdmin version')} + {$Think.config.fastadmin.version} 检查最新版 + + + {:__('FastAdmin addon version')} + {$addonversion} + + + {:__('Thinkphp version')} + {:THINK_VERSION} + + + {:__('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} + + +
@@ -429,38 +498,10 @@
- - \ No newline at end of file diff --git a/application/admin/view/general/config/index.html b/application/admin/view/general/config/index.html index 1571c70a..9ec09c4f 100644 --- a/application/admin/view/general/config/index.html +++ b/application/admin/view/general/config/index.html @@ -52,13 +52,13 @@
{switch $item.type} {case string} - + {/case} {case text} - + {/case} {case editor} - + {/case} {case array}
@@ -67,7 +67,7 @@ {:__('Array value')}
{:__('Append')}
- +
{/case} {case datetime} @@ -97,7 +97,7 @@ {case value="image" break="0"}{/case} {case value="images"}
- + @@ -107,7 +107,7 @@ {case value="file" break="0"}{/case} {case value="files"}
- + diff --git a/application/admin/view/general/profile/index.html b/application/admin/view/general/profile/index.html index ff0995ee..6b9992fa 100644 --- a/application/admin/view/general/profile/index.html +++ b/application/admin/view/general/profile/index.html @@ -60,15 +60,15 @@

{$admin.email}

- +
- +
- +
diff --git a/application/admin/view/user/group/edit.html b/application/admin/view/user/group/edit.html index b6227768..ec4da8e7 100644 --- a/application/admin/view/user/group/edit.html +++ b/application/admin/view/user/group/edit.html @@ -3,7 +3,7 @@
- +
diff --git a/application/admin/view/user/rule/edit.html b/application/admin/view/user/rule/edit.html index 1fdd5734..f6c9ebe2 100644 --- a/application/admin/view/user/rule/edit.html +++ b/application/admin/view/user/rule/edit.html @@ -15,19 +15,19 @@
- +
- +
- +
diff --git a/application/admin/view/user/user/edit.html b/application/admin/view/user/user/edit.html index 36d0fcb5..426289bd 100644 --- a/application/admin/view/user/user/edit.html +++ b/application/admin/view/user/user/edit.html @@ -9,13 +9,13 @@
- +
- +
@@ -27,13 +27,13 @@
- +
- +
@@ -71,7 +71,7 @@
- +
diff --git a/application/config.php b/application/config.php index 602ac44c..892816b6 100755 --- a/application/config.php +++ b/application/config.php @@ -272,7 +272,7 @@ return [ //自动检测更新 'checkupdate' => false, //版本号 - 'version' => '1.0.0.20190418_beta', + 'version' => '1.0.0.20190510_beta', //API接口地址 'api_url' => 'https://api.fastadmin.net', ], diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php index e72ff83a..f3858e0c 100755 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -3,7 +3,6 @@ namespace app\index\controller; use app\common\controller\Frontend; -use app\common\library\Token; class Index extends Frontend { diff --git a/application/index/controller/User.php b/application/index/controller/User.php index 1b8bd318..b1dbc916 100644 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -75,7 +75,7 @@ class User extends Frontend */ public function register() { - $url = $this->request->request('url'); + $url = $this->request->request('url', '', 'trim'); if ($this->auth->id) { $this->success(__('You\'ve logged in, do not login again'), $url ? $url : url('user/index')); } @@ -127,7 +127,7 @@ class User extends Frontend //判断来源 $referer = $this->request->server('HTTP_REFERER'); if (!$url && (strtolower(parse_url($referer, PHP_URL_HOST)) == strtolower($this->request->host())) - && !preg_match("/(user\/login|user\/register)/i", $referer)) { + && !preg_match("/(user\/login|user\/register|user\/logout)/i", $referer)) { $url = $referer; } $this->view->assign('url', $url); @@ -140,7 +140,7 @@ class User extends Frontend */ public function login() { - $url = $this->request->request('url'); + $url = $this->request->request('url', '', 'trim'); if ($this->auth->id) { $this->success(__('You\'ve logged in, do not login again'), $url ? $url : url('user/index')); } @@ -181,7 +181,7 @@ class User extends Frontend //判断来源 $referer = $this->request->server('HTTP_REFERER'); if (!$url && (strtolower(parse_url($referer, PHP_URL_HOST)) == strtolower($this->request->host())) - && !preg_match("/(user\/login|user\/register)/i", $referer)) { + && !preg_match("/(user\/login|user\/register|user\/logout)/i", $referer)) { $url = $referer; } $this->view->assign('url', $url); diff --git a/application/index/view/user/login.html b/application/index/view/user/login.html index 6184b730..ff2af389 100755 --- a/application/index/view/user/login.html +++ b/application/index/view/user/login.html @@ -1,6 +1,6 @@