Browse Source

新增附件管理标签过滤
新增语言包缓存
新增生成文件后缀图片
新增Layer弹窗自动获得焦点
新增附件图片按序选择填充
新增插件管理一键切换无远程插件模式
优化表格列表开关组件
优化安装脚本
优化CRUD菜单删除
优化前台模板
优化插件列表接口检测
优化系统配置

Karson 5 years ago
parent
commit
c6f44aa060
71 changed files with 926 additions and 1319 deletions
  1. 11 11
      README.md
  2. 2 2
      application/admin/command/Addon.php
  3. 2 1
      application/admin/command/Api.php
  4. 2 3
      application/admin/command/Api/template/index.html
  5. 8 0
      application/admin/command/Crud.php
  6. 220 35
      application/admin/command/Install.php
  7. 19 44
      application/admin/command/Install/fastadmin.sql
  8. 316 0
      application/admin/command/Install/install.html
  9. 34 0
      application/admin/command/Install/zh-cn.php
  10. 9 5
      application/admin/command/Menu.php
  11. 40 10
      application/admin/common.php
  12. 1 1
      application/admin/controller/Addon.php
  13. 18 0
      application/admin/controller/Ajax.php
  14. 3 4
      application/admin/controller/auth/Rule.php
  15. 9 4
      application/admin/controller/general/Attachment.php
  16. 26 17
      application/admin/controller/general/Config.php
  17. 2 2
      application/admin/lang/zh-cn.php
  18. 4 4
      application/admin/lang/zh-cn/addon.php
  19. 0 1
      application/admin/lang/zh-cn/dashboard.php
  20. 1 0
      application/admin/lang/zh-cn/general/config.php
  21. 11 17
      application/admin/view/addon/index.html
  22. 2 2
      application/admin/view/auth/adminlog/detail.html
  23. 1 22
      application/admin/view/common/header.html
  24. 1 6
      application/admin/view/common/menu.html
  25. 0 122
      application/admin/view/dashboard/index.html
  26. 3 3
      application/admin/view/general/attachment/edit.html
  27. 11 2
      application/admin/view/general/attachment/index.html
  28. 11 1
      application/admin/view/general/attachment/select.html
  29. 1 1
      application/admin/view/general/config/index.html
  30. 2 2
      application/admin/view/index/index.html
  31. 1 3
      application/admin/view/index/login.html
  32. 1 1
      application/admin/view/layout/default.html
  33. 1 0
      application/common/controller/Api.php
  34. 1 2
      application/common/controller/Backend.php
  35. 1 0
      application/common/controller/Frontend.php
  36. 13 0
      application/common/model/Attachment.php
  37. 0 3
      application/common/view/tpl/dispatch_jump.tpl
  38. 1 1
      application/config.php
  39. 1 1
      application/database.php
  40. 1 1
      application/extra/site.php
  41. 7 2
      application/index/controller/Ajax.php
  42. 0 6
      application/index/controller/Index.php
  43. 1 9
      application/index/lang/en/index.php
  44. 1 3
      application/index/lang/zh-cn.php
  45. 1 10
      application/index/lang/zh-cn/index.php
  46. 1 1
      application/index/view/common/captcha.html
  47. 1 2
      application/index/view/common/meta.html
  48. 1 1
      application/index/view/common/sidenav.html
  49. 6 128
      application/index/view/index/index.html
  50. 3 12
      application/index/view/layout/default.html
  51. 1 1
      application/index/view/user/index.html
  52. 1 1
      public/admin.php
  53. 17 8
      public/api.html
  54. 1 1
      public/assets/css/backend.min.css
  55. 1 1
      public/assets/css/frontend.min.css
  56. 2 184
      public/assets/css/index.css
  57. BIN
      public/assets/img/logo.png
  58. BIN
      public/assets/img/logo.psd
  59. 9 9
      public/assets/js/backend/addon.js
  60. 2 2
      public/assets/js/backend/auth/adminlog.js
  61. 1 1
      public/assets/js/backend/category.js
  62. 27 8
      public/assets/js/backend/general/attachment.js
  63. 2 85
      public/assets/js/backend/index.js
  64. 3 0
      public/assets/js/require-backend.js
  65. 10 4
      public/assets/js/require-backend.min.js
  66. 3 0
      public/assets/js/require-frontend.js
  67. 5 2
      public/assets/js/require-frontend.min.js
  68. 3 1
      public/assets/js/require-table.js
  69. 2 2
      public/assets/js/require-upload.js
  70. 1 1
      public/index.php
  71. 22 500
      public/install.php

+ 11 - 11
README.md

@@ -1,7 +1,7 @@
 FastAdmin是一款基于ThinkPHP5+Bootstrap的极速后台开发框架。
 
 
-## **主要特性**
+## 主要特性
 
 * 基于`Auth`验证的权限管理系统
     * 支持无限级父子级权限继承,父级的管理员可任意增删改子级管理员及权限设置
@@ -24,6 +24,8 @@ FastAdmin是一款基于ThinkPHP5+Bootstrap的极速后台开发框架。
 * 二级域名部署支持,同时域名支持绑定到插件
 * 多语言支持,服务端及客户端支持
 * 强大的第三方模块支持([CMS](https://www.fastadmin.net/store/cms.html)、[博客](https://www.fastadmin.net/store/blog.html)、[知识付费问答](https://www.fastadmin.net/store/ask.html)、[在线投票系统](https://www.fastadmin.net/store/vote.html))
+* 支持CMS、博客、知识付费问答无缝整合[Xunsearch全文搜索](https://www.fastadmin.net/store/xunsearch.html)
+* 第三方小程序支持([预订小程序](https://www.fastadmin.net/store/ball.html)、[问答小程序](https://www.fastadmin.net/store/questions.html)、[活动报名小程序](https://www.fastadmin.net/store/huodong.html)、[商城小程序](https://www.fastadmin.net/store/xshop.html)、[博客小程序](https://www.fastadmin.net/store/blog.html))
 * 整合第三方短信接口(阿里云、腾讯云短信)
 * 无缝整合第三方云存储(七牛、阿里云OSS、又拍云)功能
 * 第三方富文本编辑器支持(Summernote、Kindeditor、百度编辑器)
@@ -31,11 +33,11 @@ FastAdmin是一款基于ThinkPHP5+Bootstrap的极速后台开发框架。
 * 第三方支付(微信、支付宝)无缝整合,微信支持PC端扫码支付
 * 丰富的插件应用市场
 
-## **安装使用**
+## 安装使用
 
 https://doc.fastadmin.net
 
-## **在线演示**
+## 在线演示
 
 https://demo.fastadmin.net
 
@@ -45,24 +47,22 @@ https://demo.fastadmin.net
 
 提 示:演示站数据无法进行修改,请下载源码安装体验全部功能
 
-## **界面截图**
+## 界面截图
 ![控制台](https://gitee.com/uploads/images/2017/0411/113717_e99ff3e7_10933.png "控制台")
 
-## **问题反馈**
+## 问题反馈
 
 在使用中有任何问题,请使用以下联系方式联系我们
 
 交流社区: https://ask.fastadmin.net
 
-QQ群: [636393962](https://jq.qq.com/?_wv=1027&k=487PNBb)(满) [708784003](https://jq.qq.com/?_wv=1027&k=5ObjtwM)(满) [964776039](https://jq.qq.com/?_wv=1027&k=59qjU2P)(3群) [749803490](https://jq.qq.com/?_wv=1027&k=5tczi88)(满) [767103006](https://jq.qq.com/?_wv=1027&k=5Z1U751)(5群)
-
-Email: (karson#fastadmin.net, 把#换成@)
+QQ群: [636393962](https://jq.qq.com/?_wv=1027&k=487PNBb)(满) [708784003](https://jq.qq.com/?_wv=1027&k=5ObjtwM)(满) [964776039](https://jq.qq.com/?_wv=1027&k=59qjU2P)(3群) [749803490](https://jq.qq.com/?_wv=1027&k=5tczi88)(满) [767103006](https://jq.qq.com/?_wv=1027&k=5Z1U751)(满) [675115483](https://jq.qq.com/?_wv=1027&k=54I6mts)(6群)
 
 Github: https://github.com/karsonzhang/fastadmin
 
 Gitee: https://gitee.com/karson/fastadmin
 
-## **特别鸣谢**
+## 特别鸣谢
 
 感谢以下的项目,排名不分先后
 
@@ -81,7 +81,7 @@ Nice-validator: https://validator.niceue.com
 SelectPage: https://github.com/TerryZ/SelectPage
 
 
-## **版权信息**
+## 版权信息
 
 FastAdmin遵循Apache2开源协议发布,并提供免费使用。
 
@@ -89,4 +89,4 @@ FastAdmin遵循Apache2开源协议发布,并提供免费使用。
 
 版权所有Copyright © 2017-2020 by FastAdmin (https://www.fastadmin.net)
 
-All rights reserved。
+All rights reserved。

+ 2 - 2
application/admin/command/Addon.php

@@ -34,8 +34,8 @@ class Addon extends Command
     {
         $name = $input->getOption('name') ?: '';
         $action = $input->getOption('action') ?: '';
-        if (stripos($name, 'addons/') !== false) {
-            $name = explode('/', $name)[1];
+        if (stripos($name, 'addons' . DS) !== false) {
+            $name = explode(DS, $name)[1];
         }
         //强制覆盖
         $force = $input->getOption('force');

+ 2 - 1
application/admin/command/Api.php

@@ -96,6 +96,7 @@ class Api extends Command
         $classes = array_unique(array_filter($classes));
 
         $config = [
+            'sitename'    => config('site.name'),
             'title'       => $title,
             'author'      => $author,
             'description' => '',
@@ -115,8 +116,8 @@ class Api extends Command
      * get full qualified class name
      *
      * @param string $path_to_file
-     * @author JBYRNE http://jarretbyrne.com/2015/06/197/
      * @return string
+     * @author JBYRNE http://jarretbyrne.com/2015/06/197/
      */
     protected function get_class_from_file($path_to_file)
     {

+ 2 - 3
application/admin/command/Api/template/index.html

@@ -5,7 +5,6 @@
         <meta http-equiv="X-UA-Compatible" content="IE=edge">
         <meta name="viewport" content="width=device-width, initial-scale=1.0">
         <meta name="description" content="">
-        <meta name="author" content="{$config.author}">
         <title>{$config.title}</title>
 
         <!-- Bootstrap Core CSS -->
@@ -109,7 +108,7 @@
                         <span class="icon-bar"></span>
                         <span class="icon-bar"></span>
                     </button>
-                    <a class="navbar-brand" href="https://www.fastadmin.net" target="_blank">{$config.title}</a>
+                    <a class="navbar-brand" href="./" target="_blank">{$config.title}</a>
                 </div>
                 <div class="navbar-collapse collapse">
                     <form class="navbar-form navbar-right">
@@ -350,7 +349,7 @@
                     Generated on {:date('Y-m-d H:i:s')}
                 </div>
                 <div class="col-md-6" align="right">
-                    <a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
+                    <a href="./" target="_blank">{$config.sitename}</a>
                 </div>
             </div>
 

+ 8 - 0
application/admin/command/Crud.php

@@ -440,6 +440,11 @@ class Crud extends Command
                 }
             }
 
+            //继续删除菜单
+            if ($menu) {
+                exec("php think menu -c {$controllerUrl} -d 1 -f 1");
+            }
+
             $output->info("Delete Successed");
             return;
         }
@@ -1455,6 +1460,9 @@ EOD;
         if (in_array($formatter, ['image', 'images'])) {
             $html .= ", events: Table.api.events.image";
         }
+        if (in_array($formatter, ['toggle'])) {
+            $html .= ", table: table";
+        }
         if ($itemArr && !$formatter) {
             $formatter = 'normal';
         }

+ 220 - 35
application/admin/command/Install.php

@@ -2,6 +2,7 @@
 
 namespace app\admin\command;
 
+use fast\Random;
 use PDO;
 use think\Config;
 use think\console\Command;
@@ -10,10 +11,22 @@ use think\console\input\Option;
 use think\console\Output;
 use think\Db;
 use think\Exception;
+use think\Lang;
+use think\Request;
+use think\View;
 
 class Install extends Command
 {
     protected $model = null;
+    /**
+     * @var \think\View 视图类实例
+     */
+    protected $view;
+
+    /**
+     * @var \think\Request Request 实例
+     */
+    protected $request;
 
     protected function configure()
     {
@@ -30,8 +43,12 @@ class Install extends Command
             ->setDescription('New installation of FastAdmin');
     }
 
+    /**
+     * 命令行安装
+     */
     protected function execute(Input $input, Output $output)
     {
+        define('INSTALL_PATH', APP_PATH . 'admin' . DS . 'command' . DS . 'Install' . DS);
         // 覆盖安装
         $force = $input->getOption('force');
         $hostname = $input->getOption('hostname');
@@ -41,68 +58,236 @@ class Install extends Command
         $username = $input->getOption('username');
         $password = $input->getOption('password');
 
-        $installLockFile = __DIR__ . "/Install/install.lock";
+        $installLockFile = INSTALL_PATH . "install.lock";
         if (is_file($installLockFile) && !$force) {
             throw new Exception("\nFastAdmin already installed!\nIf you need to reinstall again, use the parameter --force=true ");
         }
 
-        $sql = file_get_contents(__DIR__ . '/Install/fastadmin.sql');
+        $adminUsername = 'admin';
+        $adminPassword = Random::alnum(10);
+        $adminEmail = 'admin@admin.com';
+        $siteName = __('My Website');
 
-        $sql = str_replace("`fa_", "`{$prefix}", $sql);
+        $adminName = $this->installation($hostname, $hostport, $database, $username, $password, $prefix, $adminUsername, $adminPassword, $adminEmail, $siteName);
+        if ($adminName) {
+            $output->highlight("Admin url:http://www.yoursite.com/{$adminName}");
+        }
 
-        // 先尝试能否自动创建数据库
-        $config = Config::get('database');
-        $pdo = new PDO("{$config['type']}:host={$hostname}" . ($hostport ? ";port={$hostport}" : ''), $username, $password);
-        $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-        $pdo->query("CREATE DATABASE IF NOT EXISTS `{$database}` CHARACTER SET utf8 COLLATE utf8_general_ci;");
+        $output->highlight("Admin username:{$adminUsername}");
+        $output->highlight("Admin password:{$adminPassword}");
 
-        // 连接install命令中指定的数据库
-        $instance = Db::connect([
-            'type' => "{$config['type']}",
-            'hostname' => "{$hostname}",
-            'hostport' => "{$hostport}",
-            'database' => "{$database}",
-            'username' => "{$username}",
-            'password' => "{$password}",
-        ]);
+        \think\Cache::rm('__menu__');
 
-        // 查询一次SQL,判断连接是否正常
-        $instance->execute("SELECT 1");
+        $output->info("Install Successed!");
+    }
 
-        // 调用原生PDO对象进行批量查询
-        $instance->getPdo()->exec($sql);
+    /**
+     * PC端安装
+     */
+    public function index()
+    {
+        $this->view = View::instance(Config::get('template'), Config::get('view_replace_str'));
+        $this->request = Request::instance();
+
+        define('INSTALL_PATH', APP_PATH . 'admin' . DS . 'command' . DS . 'Install' . DS);
+        Lang::load(INSTALL_PATH . $this->request->langset() . '.php');
 
-        file_put_contents($installLockFile, 1);
+        $installLockFile = INSTALL_PATH . "install.lock";
+
+        if (is_file($installLockFile)) {
+            echo __('The system has been installed. If you need to reinstall, please remove %s first', 'install.lock');
+            exit;
+        }
+        $output = function ($code, $msg, $url = null, $data = null) {
+            return json(['code' => $code, 'msg' => $msg, 'url' => $url, 'data' => $data]);
+        };
+
+        if ($this->request->isPost()) {
+            $mysqlHostname = $this->request->post('mysqlHostname', '127.0.0.1');
+            $mysqlHostport = $this->request->post('mysqlHostport', '3306');
+            $hostArr = explode(':', $mysqlHostname);
+            if (count($hostArr) > 1) {
+                $mysqlHostname = $hostArr[0];
+                $mysqlHostport = $hostArr[1];
+            }
+            $mysqlUsername = $this->request->post('mysqlUsername', 'root');
+            $mysqlPassword = $this->request->post('mysqlPassword', '');
+            $mysqlDatabase = $this->request->post('mysqlDatabase', '');
+            $mysqlPrefix = $this->request->post('mysqlPrefix', 'fa_');
+            $adminUsername = $this->request->post('adminUsername', 'admin');
+            $adminPassword = $this->request->post('adminPassword', '');
+            $adminPasswordConfirmation = $this->request->post('adminPasswordConfirmation', '');
+            $adminEmail = $this->request->post('adminEmail', 'admin@admin.com');
+            $siteName = $this->request->post('siteName', __('My Website'));
+
+            if ($adminPassword !== $adminPasswordConfirmation) {
+                return $output(0, __('The two passwords you entered did not match'));
+            }
+
+            $adminName = '';
+            try {
+                $adminName = $this->installation($mysqlHostname, $mysqlHostport, $mysqlDatabase, $mysqlUsername, $mysqlPassword, $mysqlPrefix, $adminUsername, $adminPassword, $adminEmail, $siteName);
+            } catch (\PDOException $e) {
+                throw new Exception($e->getMessage());
+            } catch (\Exception $e) {
+                return $output(0, $e->getMessage());
+            }
+            return $output(1, __('Install Successed'), null, ['adminName' => $adminName]);
+        }
+        $errInfo = '';
+        try {
+            $this->checkenv();
+        } catch (\Exception $e) {
+            $errInfo = $e->getMessage();
+        }
+        return $this->view->fetch(INSTALL_PATH . "install.html", ['errInfo' => $errInfo]);
+    }
+
+    /**
+     * 执行安装
+     */
+    protected function installation($mysqlHostname, $mysqlHostport, $mysqlDatabase, $mysqlUsername, $mysqlPassword, $mysqlPrefix, $adminUsername, $adminPassword, $adminEmail = null, $siteName = null)
+    {
+        $this->checkenv();
+
+        if ($mysqlDatabase == '') {
+            throw new Exception(__('Please input correct database'));
+        }
+        if (!preg_match("/^\w{3,12}$/", $adminUsername)) {
+            throw new Exception(__('Please input correct username'));
+        }
+        if (!preg_match("/^[\S]{6,16}$/", $adminPassword)) {
+            throw new Exception(__('Please input correct password'));
+        }
+        if ($siteName == '' || preg_match("/fast" . "admin/i", $siteName)) {
+            throw new Exception(__('Please input correct website'));
+        }
 
-        //后台入口文件
+        $sql = file_get_contents(INSTALL_PATH . 'fastadmin.sql');
+
+        $sql = str_replace("`fa_", "`{$mysqlPrefix}", $sql);
+
+        // 先尝试能否自动创建数据库
+        $config = Config::get('database');
+        try {
+            $pdo = new PDO("{$config['type']}:host={$mysqlHostname}" . ($mysqlHostport ? ";port={$mysqlHostport}" : ''), $mysqlUsername, $mysqlPassword);
+            $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+            $pdo->query("CREATE DATABASE IF NOT EXISTS `{$mysqlDatabase}` CHARACTER SET utf8 COLLATE utf8_general_ci;");
+
+            // 连接install命令中指定的数据库
+            $instance = Db::connect([
+                'type'     => "{$config['type']}",
+                'hostname' => "{$mysqlHostname}",
+                'hostport' => "{$mysqlHostport}",
+                'database' => "{$mysqlDatabase}",
+                'username' => "{$mysqlUsername}",
+                'password' => "{$mysqlPassword}",
+                'prefix'   => "{$mysqlPrefix}",
+            ]);
+
+            // 查询一次SQL,判断连接是否正常
+            $instance->execute("SELECT 1");
+
+            // 调用原生PDO对象进行批量查询
+            $instance->getPdo()->exec($sql);
+        } catch (\PDOException $e) {
+            throw new Exception($e->getMessage());
+        }
+        // 后台入口文件
         $adminFile = ROOT_PATH . 'public' . DS . 'admin.php';
 
+        // 数据库配置文件
         $dbConfigFile = APP_PATH . 'database.php';
         $config = @file_get_contents($dbConfigFile);
-        $callback = function ($matches) use ($hostname, $hostport, $username, $password, $database, $prefix) {
-            $field = $matches[1];
+        $callback = function ($matches) use ($mysqlHostname, $mysqlHostport, $mysqlUsername, $mysqlPassword, $mysqlDatabase, $mysqlPrefix) {
+            $field = "mysql" . ucfirst($matches[1]);
             $replace = $$field;
-            if ($matches[1] == 'hostport' && $hostport == 3306) {
+            if ($matches[1] == 'hostport' && $mysqlHostport == 3306) {
                 $replace = '';
             }
             return "'{$matches[1]}'{$matches[2]}=>{$matches[3]}Env::get('database.{$matches[1]}', '{$replace}'),";
         };
         $config = preg_replace_callback("/'(hostname|database|username|password|hostport|prefix)'(\s+)=>(\s+)Env::get\((.*)\)\,/", $callback, $config);
-        // 写入数据库配置
-        file_put_contents($dbConfigFile, $config);
 
+        // 检测能否成功写入数据库配置
+        $result = @file_put_contents($dbConfigFile, $config);
+        if (!$result) {
+            throw new Exception(__('The current permissions are insufficient to write the file %s', 'application/database.php'));
+        }
+
+        // 变更默认管理员密码
+        $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];
+        $instance->name('admin')->where('username', 'admin')->update($data);
         // 修改后台入口
+        $adminName = '';
         if (is_file($adminFile)) {
-            $x = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
-            $adminName = substr(str_shuffle(str_repeat($x, ceil(10 / strlen($x)))), 1, 10) . '.php';
+            $adminName = Random::alpha(10) . '.php';
             rename($adminFile, ROOT_PATH . 'public' . DS . $adminName);
-            $output->highlight("Admin url:http://www.yoursite.com/{$adminName}");
         }
-        $output->highlight("Admin username:admin");
-        $output->highlight("Admin password:123456");
 
-        \think\Cache::rm('__menu__');
+        //修改站点名称
+        if ($siteName != __('My Website')) {
+            $instance->name('config')->where('name', 'name')->update(['value' => $siteName]);
+            $configFile = APP_PATH . 'extra' . DS . 'site.php';
+            $config = include $configFile;
+            $configList = $instance->name("config")->select();
+            foreach ($configList as $k => $value) {
+                if (in_array($value['type'], ['selects', 'checkbox', 'images', 'files'])) {
+                    $value['value'] = explode(',', $value['value']);
+                }
+                if ($value['type'] == 'array') {
+                    $value['value'] = (array)json_decode($value['value'], true);
+                }
+                $config[$value['name']] = $value['value'];
+            }
+            $config['name'] = $siteName;
+            file_put_contents($configFile, '<?php' . "\n\nreturn " . var_export($config, true) . ";");
+        }
 
-        $output->info("Install Successed!");
+        $installLockFile = INSTALL_PATH . "install.lock";
+        //检测能否成功写入lock文件
+        $result = @file_put_contents($installLockFile, 1);
+        if (!$result) {
+            throw new Exception(__('The current permissions are insufficient to write the file %s', 'application/admin/command/Install/install.lock'));
+        }
+
+        return $adminName;
+    }
+
+    /**
+     * 检测环境
+     */
+    protected function checkenv()
+    {
+        // 检测目录是否存在
+        $checkDirs = [
+            'thinkphp',
+            'vendor',
+            'public' . DS . 'assets' . DS . 'libs'
+        ];
+
+        //数据库配置文件
+        $dbConfigFile = APP_PATH . 'database.php';
+
+        if (version_compare(PHP_VERSION, '5.5.0', '<')) {
+            throw new Exception(__("The current version %s is too low, please use PHP 5.5 or higher", PHP_VERSION));
+        }
+        if (!extension_loaded("PDO")) {
+            throw new Exception(__("PDO is not currently installed and cannot be installed"));
+        }
+        if (!is_really_writable($dbConfigFile)) {
+            throw new Exception(__('The current permissions are insufficient to write the configuration file application/database.php'));
+        }
+        foreach ($checkDirs as $k => $v) {
+            if (!is_dir(ROOT_PATH . $v)) {
+                throw new Exception(__('Please go to the official website to download the full package or resource package and try to install'));
+                break;
+            }
+        }
+        return true;
     }
 }

+ 19 - 44
application/admin/command/Install/fastadmin.sql

@@ -1,9 +1,5 @@
 /*
  FastAdmin Install SQL
-
- 官网: https://www.fastadmin.net
- 演示: https://demo.fastadmin.net
-
  Date: 2018年05月26日
 */
 
@@ -30,13 +26,13 @@ CREATE TABLE `fa_admin` (
   `status` varchar(30) NOT NULL DEFAULT 'normal' COMMENT '状态',
   PRIMARY KEY (`id`),
   UNIQUE KEY `username` (`username`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='管理员表';
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员表';
 
 -- ----------------------------
 -- Records of fa_admin
 -- ----------------------------
 BEGIN;
-INSERT INTO `fa_admin` VALUES (1, 'admin', 'Admin', '075eaec83636846f51c152f29b98a2fd', 's4f3', '/assets/img/avatar.png', 'admin@fastadmin.net', 0, 1502029281, '127.0.0.1',1492186163, 1502029281, 'd3992c3b-5ecc-4ecb-9dc2-8997780fcadc', 'normal');
+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');
 COMMIT;
 
 -- ----------------------------
@@ -55,7 +51,7 @@ CREATE TABLE `fa_admin_log` (
   `createtime` int(10) DEFAULT NULL COMMENT '操作时间',
   PRIMARY KEY (`id`),
   KEY `name` (`username`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='管理员日志表';
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='管理员日志表';
 
 -- ----------------------------
 -- Table structure for fa_attachment
@@ -79,7 +75,7 @@ CREATE TABLE `fa_attachment` (
   `storage` varchar(100) NOT NULL DEFAULT 'local' COMMENT '存储位置',
   `sha1` varchar(40) NOT NULL DEFAULT '' COMMENT '文件 sha1编码',
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='附件表';
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='附件表';
 
 -- ----------------------------
 -- Records of fa_attachment
@@ -101,7 +97,7 @@ CREATE TABLE `fa_auth_group` (
   `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
   `status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态',
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='分组表';
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='分组表';
 
 -- ----------------------------
 -- Records of fa_auth_group
@@ -124,7 +120,7 @@ CREATE TABLE `fa_auth_group_access` (
   UNIQUE KEY `uid_group_id` (`uid`,`group_id`),
   KEY `uid` (`uid`),
   KEY `group_id` (`group_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='权限分组表';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='权限分组表';
 
 -- ----------------------------
 -- Records of fa_auth_group_access
@@ -155,7 +151,7 @@ CREATE TABLE `fa_auth_rule` (
   UNIQUE KEY `name` (`name`) USING BTREE,
   KEY `pid` (`pid`),
   KEY `weigh` (`weigh`)
-) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='节点表';
+) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8 COMMENT='节点表';
 
 -- ----------------------------
 -- Records of fa_auth_rule
@@ -267,7 +263,7 @@ CREATE TABLE `fa_category` (
   PRIMARY KEY (`id`),
   KEY `weigh` (`weigh`,`id`),
   KEY `pid` (`pid`)
-) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='分类表';
+) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COMMENT='分类表';
 
 -- ----------------------------
 -- Records of fa_category
@@ -305,13 +301,13 @@ CREATE TABLE `fa_config` (
   `extend` varchar(255) NOT NULL DEFAULT '' COMMENT '扩展属性',
   PRIMARY KEY (`id`),
   UNIQUE KEY `name` (`name`)
-) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统配置';
+) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='系统配置';
 
 -- ----------------------------
 -- Records of fa_config
 -- ----------------------------
 BEGIN;
-INSERT INTO `fa_config` VALUES (1, 'name', 'basic', 'Site name', '请填写站点名称', 'string', 'FastAdmin', '', 'required', '');
+INSERT INTO `fa_config` VALUES (1, 'name', 'basic', 'Site name', '请填写站点名称', 'string', '我的网站', '', 'required', '');
 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', '');
@@ -343,7 +339,7 @@ CREATE TABLE `fa_ems`  (
   `ip` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'IP',
   `createtime` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '创建时间',
   PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='邮箱验证码表';
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='邮箱验证码表';
 
 -- ----------------------------
 -- Table structure for fa_sms
@@ -358,7 +354,7 @@ CREATE TABLE `fa_sms` (
   `ip` varchar(30) NOT NULL DEFAULT '' COMMENT 'IP',
   `createtime` int(10) unsigned DEFAULT '0' COMMENT '创建时间',
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='短信验证码表';
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='短信验证码表';
 
 -- ----------------------------
 -- Table structure for fa_test
@@ -397,7 +393,7 @@ CREATE TABLE `fa_test` (
   `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态',
   `state` enum('0','1','2') NOT NULL DEFAULT '1' COMMENT '状态值:0=禁用,1=正常,2=推荐',
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='测试表';
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='测试表';
 
 -- ----------------------------
 -- Records of fa_test
@@ -443,7 +439,7 @@ CREATE TABLE `fa_user` (
   KEY `username` (`username`),
   KEY `email` (`email`),
   KEY `mobile` (`mobile`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='会员表';
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='会员表';
 
 -- ----------------------------
 -- Records of fa_user
@@ -464,7 +460,7 @@ CREATE TABLE `fa_user_group` (
   `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
   `status` enum('normal','hidden') DEFAULT NULL COMMENT '状态',
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='会员组表';
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='会员组表';
 
 -- ----------------------------
 -- Records of fa_user_group
@@ -486,7 +482,7 @@ CREATE TABLE `fa_user_money_log` (
   `memo` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
   `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='会员余额变动表';
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='会员余额变动表';
 
 -- ----------------------------
 -- Table structure for fa_user_rule
@@ -504,7 +500,7 @@ CREATE TABLE `fa_user_rule` (
   `weigh` int(10) DEFAULT '0' COMMENT '权重',
   `status` enum('normal','hidden') DEFAULT NULL COMMENT '状态',
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='会员规则表';
+) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='会员规则表';
 
 -- ----------------------------
 -- Records of fa_user_rule
@@ -537,7 +533,7 @@ CREATE TABLE `fa_user_score_log` (
   `memo` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
   `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='会员积分变动表';
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='会员积分变动表';
 
 -- ----------------------------
 -- Table structure for fa_user_token
@@ -549,32 +545,5 @@ CREATE TABLE `fa_user_token` (
   `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
   `expiretime` int(10) DEFAULT NULL COMMENT '过期时间',
   PRIMARY KEY (`token`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='会员Token表';
-
-DROP TABLE IF EXISTS `fa_version`;
-CREATE TABLE `fa_version`  (
-  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
-  `oldversion` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '旧版本号',
-  `newversion` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '新版本号',
-  `packagesize` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '包大小',
-  `content` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '升级内容',
-  `downloadurl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '下载地址',
-  `enforce` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '强制更新',
-  `createtime` int(10) NOT NULL DEFAULT 0 COMMENT '创建时间',
-  `updatetime` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
-  `weigh` int(10) NOT NULL DEFAULT 0 COMMENT '权重',
-  `status` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '状态',
-  PRIMARY KEY (`id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT = '版本表';
-
-BEGIN;
-INSERT INTO `fa_version` (`id`, `oldversion`, `newversion`, `packagesize`, `content`, `downloadurl`, `enforce`, `createtime`, `updatetime`, `weigh`, `status`) VALUES
-(1, '1.1.1,2', '1.2.1', '20M', '更新内容', 'https://www.fastadmin.net/download.html', 1, 1520425318, 0, 0, 'normal');
-COMMIT;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会员Token表';
 SET FOREIGN_KEY_CHECKS = 1;

File diff suppressed because it is too large
+ 316 - 0
application/admin/command/Install/install.html


+ 34 - 0
application/admin/command/Install/zh-cn.php

@@ -0,0 +1,34 @@
+<?php
+return [
+    'Warning'                                                                                               => '温馨提示',
+    'Installing FastAdmin'                                                                                  => '安装FastAdmin',
+    'Mysql Hostname'                                                                                        => 'MySQL 数据库地址',
+    'Mysql Database'                                                                                        => 'MySQL 数据库名',
+    'Mysql Username'                                                                                        => 'MySQL 用户名',
+    'Mysql Password'                                                                                        => 'MySQL 密码',
+    'Mysql Prefix'                                                                                          => 'MySQL 数据表前缀',
+    'Mysql Hostport'                                                                                        => 'MySQL 端口号',
+    'Admin Username'                                                                                        => '管理者用户名',
+    'Admin Email'                                                                                           => '管理者Email',
+    'Admin Password'                                                                                        => '管理者密码',
+    'Repeat Password'                                                                                       => '重复密码',
+    'Website'                                                                                               => '网站名称',
+    'My Website'                                                                                            => '我的网站',
+    'Install now'                                                                                           => '点击安装',
+    'Installing'                                                                                            => '安装中...',
+    'Home'                                                                                                  => '访问首页',
+    'Dashboard'                                                                                             => '进入后台',
+    'Go back'                                                                                               => '返回上一页',
+    'Install Successed'                                                                                     => '安装成功!',
+    'Security tips'                                                                                         => '温馨提示:请将以下后台登录入口添加到你的收藏夹,为了你的安全,不要泄漏或发送给他人!如有泄漏请及时修改!',
+    'Please input correct database'                                                                         => '请输入正确的数据库名',
+    'Please input correct username'                                                                         => '用户名只能由3-12位数字、字母、下划线组合',
+    '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 5.5 or higher'                                       => '当前版本%s过低,请使用PHP5.5以上版本',
+    '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' => '当前代码仅包含核心代码,请前往官网下载完整包或资源包覆盖后再尝试安装',
+    'The system has been installed. If you need to reinstall, please remove %s first'                       => '当前已经安装成功,如果需要重新安装,请手动移除%s文件',
+];

+ 9 - 5
application/admin/command/Menu.php

@@ -203,14 +203,18 @@ class Menu extends Command
         $tempClassFile = __DIR__ . DS . $uniqueName . ".php";
         file_put_contents($tempClassFile, $classContent);
         $className = "\\app\\admin\\command\\" . $uniqueName;
+
+        //删除临时文件
+        register_shutdown_function(function () use ($tempClassFile) {
+            if ($tempClassFile) {
+                //删除临时文件
+                @unlink($tempClassFile);
+            }
+        });
+
         //反射机制调用类的注释和方法名
         $reflector = new ReflectionClass($className);
 
-        if (isset($tempClassFile)) {
-            //删除临时文件
-            @unlink($tempClassFile);
-        }
-
         //只匹配公共的方法
         $methods = $reflector->getMethods(ReflectionMethod::IS_PUBLIC);
         $classComment = $reflector->getDocComment();

+ 40 - 10
application/admin/common.php

@@ -10,9 +10,9 @@ if (!function_exists('build_select')) {
     /**
      * 生成下拉列表
      * @param string $name
-     * @param mixed $options
-     * @param mixed $selected
-     * @param mixed $attr
+     * @param mixed  $options
+     * @param mixed  $selected
+     * @param mixed  $attr
      * @return string
      */
     function build_select($name, $options, $selected = [], $attr = [])
@@ -28,8 +28,8 @@ if (!function_exists('build_radios')) {
     /**
      * 生成单选按钮组
      * @param string $name
-     * @param array $list
-     * @param mixed $selected
+     * @param array  $list
+     * @param mixed  $selected
      * @return string
      */
     function build_radios($name, $list = [], $selected = null)
@@ -49,8 +49,8 @@ if (!function_exists('build_checkboxs')) {
     /**
      * 生成复选按钮组
      * @param string $name
-     * @param array $list
-     * @param mixed $selected
+     * @param array  $list
+     * @param mixed  $selected
      * @return string
      */
     function build_checkboxs($name, $list = [], $selected = null)
@@ -72,9 +72,9 @@ if (!function_exists('build_category_select')) {
      * 生成分类下拉列表框
      * @param string $name
      * @param string $type
-     * @param mixed $selected
-     * @param array $attr
-     * @param array $header
+     * @param mixed  $selected
+     * @param array  $attr
+     * @param array  $header
      * @return string
      */
     function build_category_select($name, $type, $selected = null, $attr = [], $header = [])
@@ -194,3 +194,33 @@ if (!function_exists('build_heading')) {
         return $result;
     }
 }
+
+if (!function_exists('build_suffix_image')) {
+    /**
+     * 生成文件后缀图片
+     * @param string $suffix 后缀
+     * @param null   $background
+     * @return string
+     */
+    function build_suffix_image($suffix, $background = null)
+    {
+        $suffix = mb_substr(strtoupper($suffix), 0, 4);
+        $total = unpack('L', hash('adler32', $suffix, true))[1];
+        $hue = $total % 360;
+        list($r, $g, $b) = hsv2rgb($hue / 360, 0.3, 0.9);
+
+        $background = $background ? $background : "rgb({$r},{$g},{$b})";
+
+        $icon = <<<EOT
+        <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
+            <path style="fill:#E2E5E7;" d="M128,0c-17.6,0-32,14.4-32,32v448c0,17.6,14.4,32,32,32h320c17.6,0,32-14.4,32-32V128L352,0H128z"/>
+            <path style="fill:#B0B7BD;" d="M384,128h96L352,0v96C352,113.6,366.4,128,384,128z"/>
+            <polygon style="fill:#CAD1D8;" points="480,224 384,128 480,128 "/>
+            <path style="fill:{$background};" d="M416,416c0,8.8-7.2,16-16,16H48c-8.8,0-16-7.2-16-16V256c0-8.8,7.2-16,16-16h352c8.8,0,16,7.2,16,16 V416z"/>
+            <path style="fill:#CAD1D8;" d="M400,432H96v16h304c8.8,0,16-7.2,16-16v-16C416,424.8,408.8,432,400,432z"/>
+            <g><text><tspan x="220" y="380" font-size="124" font-family="Verdana, Helvetica, Arial, sans-serif" fill="white" text-anchor="middle">{$suffix}</tspan></text></g>
+        </svg>
+EOT;
+        return $icon;
+    }
+}

+ 1 - 1
application/admin/controller/Addon.php

@@ -39,7 +39,7 @@ class Addon extends Backend
             $v['config'] = $config ? 1 : 0;
             $v['url'] = str_replace($this->request->server('SCRIPT_NAME'), '', $v['url']);
         }
-        $this->assignconfig(['addons' => $addons]);
+        $this->assignconfig(['addons' => $addons, 'api_url' => config('fastadmin.api_url'), 'faversion' => config('fastadmin.version')]);
         return $this->view->fetch();
     }
 

+ 18 - 0
application/admin/controller/Ajax.php

@@ -36,6 +36,12 @@ class Ajax extends Backend
     public function lang()
     {
         header('Content-Type: application/javascript');
+        header("Cache-Control: public");
+        header("Pragma: cache");
+
+        $offset = 30 * 60 * 60 * 24; // 缓存一个月
+        header("Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT");
+
         $controllername = input("controllername");
         //默认只加载了控制器对应的语言名,你还根据控制器名来加载额外的语言包
         $this->loadlang($controllername);
@@ -290,4 +296,16 @@ class Ajax extends Backend
         $this->success('', null, $provincelist);
     }
 
+    /**
+     * 生成后缀图标
+     */
+    public function icon()
+    {
+        $suffix = $this->request->request("suffix");
+        header('Content-type: image/svg+xml');
+        $suffix = $suffix ? $suffix : "FILE";
+        echo build_suffix_image($suffix);
+        exit;
+    }
+
 }

+ 3 - 4
application/admin/controller/auth/Rule.php

@@ -10,7 +10,7 @@ use think\Cache;
 /**
  * 规则管理
  *
- * @icon fa fa-list
+ * @icon   fa fa-list
  * @remark 规则通常对应一个控制器的方法,同时左侧的菜单栏数据也从规则中体现,通常建议通过控制台进行生成规则节点
  */
 class Rule extends Backend
@@ -26,15 +26,14 @@ class Rule extends Backend
     public function _initialize()
     {
         parent::_initialize();
-        if (!$this->auth->isSuperAdmin()){
+        if (!$this->auth->isSuperAdmin()) {
             $this->error(__('Access is allowed only to the super management group'));
         }
         $this->model = model('AuthRule');
         // 必须将结果集转换为数组
-        $ruleList = collection($this->model->order('weigh', 'desc')->order('id', 'asc')->select())->toArray();
+        $ruleList = collection($this->model->field('condition,remark,createtime,updatetime', true)->order('weigh DESC,id ASC')->select())->toArray();
         foreach ($ruleList as $k => &$v) {
             $v['title'] = __($v['title']);
-            $v['remark'] = __($v['remark']);
         }
         unset($v);
         Tree::instance()->init($ruleList);

+ 9 - 4
application/admin/controller/general/Attachment.php

@@ -7,7 +7,7 @@ use app\common\controller\Backend;
 /**
  * 附件管理
  *
- * @icon fa fa-circle-o
+ * @icon   fa fa-circle-o
  * @remark 主要用于管理上传到又拍云的数据或上传至本服务的上传数据
  */
 class Attachment extends Backend
@@ -22,6 +22,7 @@ class Attachment extends Backend
     {
         parent::_initialize();
         $this->model = model('Attachment');
+        $this->view->assign("mimetypeList", \app\common\model\Attachment::getMimetypeList());
     }
 
     /**
@@ -34,13 +35,17 @@ class Attachment extends Backend
         if ($this->request->isAjax()) {
             $mimetypeQuery = [];
             $filter = $this->request->request('filter');
-            $filterArr = (array)json_decode($filter, TRUE);
-            if (isset($filterArr['mimetype']) && stripos($filterArr['mimetype'], ',') !== false) {
+            $filterArr = (array)json_decode($filter, true);
+            if (isset($filterArr['mimetype']) && preg_match("/[]\,|\*]/", $filterArr['mimetype'])) {
                 $this->request->get(['filter' => json_encode(array_diff_key($filterArr, ['mimetype' => '']))]);
                 $mimetypeQuery = function ($query) use ($filterArr) {
                     $mimetypeArr = explode(',', $filterArr['mimetype']);
                     foreach ($mimetypeArr as $index => $item) {
-                        $query->whereOr('mimetype', 'like', '%' . $item . '%');
+                        if (stripos($item, "/*") !== false) {
+                            $query->whereOr('mimetype', 'like', str_replace("/*", "/", $item) . '%');
+                        } else {
+                            $query->whereOr('mimetype', 'like', '%' . $item . '%');
+                        }
                     }
                 };
             }

+ 26 - 17
application/admin/controller/general/Config.php

@@ -11,7 +11,7 @@ use think\Validate;
 /**
  * 系统配置
  *
- * @icon fa fa-cogs
+ * @icon   fa fa-cogs
  * @remark 可以在此增改系统的变量和分组,也可以自定义分组和变量,如果需要删除请从数据库中删除
  */
 class Config extends Backend
@@ -27,6 +27,11 @@ class Config extends Backend
     {
         parent::_initialize();
         $this->model = model('Config');
+        ConfigModel::event('before_write', function ($row) {
+            if (isset($row['name']) && $row['name'] == 'name' && preg_match("/fast" . "admin/i", $row['value'])) {
+                throw new Exception(__("Site name incorrect"));
+            }
+        });
     }
 
     /**
@@ -79,26 +84,26 @@ class Config extends Backend
                 foreach ($params as $k => &$v) {
                     $v = is_array($v) ? implode(',', $v) : $v;
                 }
+                if (in_array($params['type'], ['select', 'selects', 'checkbox', 'radio', 'array'])) {
+                    $params['content'] = json_encode(ConfigModel::decode($params['content']), JSON_UNESCAPED_UNICODE);
+                } else {
+                    $params['content'] = '';
+                }
                 try {
-                    if (in_array($params['type'], ['select', 'selects', 'checkbox', 'radio', 'array'])) {
-                        $params['content'] = json_encode(ConfigModel::decode($params['content']), JSON_UNESCAPED_UNICODE);
-                    } else {
-                        $params['content'] = '';
-                    }
                     $result = $this->model->create($params);
-                    if ($result !== false) {
-                        try {
-                            $this->refreshFile();
-                        } catch (Exception $e) {
-                            $this->error($e->getMessage());
-                        }
-                        $this->success();
-                    } else {
-                        $this->error($this->model->getError());
-                    }
                 } catch (Exception $e) {
                     $this->error($e->getMessage());
                 }
+                if ($result !== false) {
+                    try {
+                        $this->refreshFile();
+                    } catch (Exception $e) {
+                        $this->error($e->getMessage());
+                    }
+                    $this->success();
+                } else {
+                    $this->error($this->model->getError());
+                }
             }
             $this->error(__('Parameter %s can not be empty', ''));
         }
@@ -128,7 +133,11 @@ class Config extends Backend
                         $configList[] = $v->toArray();
                     }
                 }
-                $this->model->allowField(true)->saveAll($configList);
+                try {
+                    $this->model->allowField(true)->saveAll($configList);
+                } catch (Exception $e) {
+                    $this->error($e->getMessage());
+                }
                 try {
                     $this->refreshFile();
                 } catch (Exception $e) {

+ 2 - 2
application/admin/lang/zh-cn.php

@@ -172,10 +172,10 @@ return [
     'Second group 2'                                        => '二级管理组2',
     'Third group 2'                                         => '三级管理组2',
     'Dashboard tips'                                        => '用于展示当前系统中的统计数据、统计报表及重要实时数据',
-    'Config tips'                                           => '可以在此增改系统的变量和分组,也可以自定义分组和变量,如果需要删除请从数据库中删除',
+    'Config tips'                                           => '可以在此增改系统的变量和分组,也可以自定义分组和变量',
     'Category tips'                                         => '用于统一管理网站的所有分类,分类可进行无限级分类,分类类型请在常规管理->系统配置->字典配置中添加',
     'Attachment tips'                                       => '主要用于管理上传到服务器或第三方存储的数据',
-    'Addon tips'                                            => '可在线安装、卸载、禁用、启用插件,同时支持添加本地插件。FastAdmin已上线插件商店 ,你可以发布你的免费或付费插件:<a href="https://www.fastadmin.net/store.html" target="_blank">https://www.fastadmin.net/store.html</a>',
+    'Addon tips'                                            => '可在线安装、卸载、禁用、启用插件,同时支持添加本地插件。',
     'Admin tips'                                            => '一个管理员可以有多个角色组,左侧的菜单根据管理员所拥有的权限进行生成',
     'Admin log tips'                                        => '管理员可以查看自己所拥有的权限的管理员日志',
     'Group tips'                                            => '角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别的下级角色组或管理员',

+ 4 - 4
application/admin/lang/zh-cn/addon.php

@@ -18,18 +18,18 @@ return [
     'Conflict tips'                  => '此插件中发现和现有系统中部分文件发现冲突!以下文件将会被影响,请备份好相关文件后再继续操作',
     'Login tips'                     => '此处登录账号为<a href="https://www.fastadmin.net" target="_blank">FastAdmin官网账号</a>',
     'Logined tips'                   => '你好!%s<br />当前你已经登录,将同步保存你的购买记录',
-    'Pay tips'                       => '扫码支付后如果仍然无法立即下载,请不要重复支付,请加<a href="https://jq.qq.com/?_wv=1027&k=487PNBb" target="_blank">QQ群:636393962</a>向管理员反馈',
+    'Pay tips'                       => '扫码支付后如果仍然无法立即下载,请不要重复支付,请稍后再重试安装!',
     'Pay click tips'                 => '请点击这里在新窗口中进行支付!',
     'Pay new window tips'            => '请在新弹出的窗口中进行支付,支付完成后再重新点击安装按钮进行安装!',
     'Uninstall tips'                 => '确认卸载<b>[%s]</b>?<p class="text-danger">卸载将会删除所有插件文件且不可找回!!! 插件如果有创建数据库表请手动删除!!!</p>如有重要数据请备份后再操作!',
-    'Upgrade tips'                   => '确认升级<b>[%s]</b>?<p class="text-danger">如果之前购买插件时未登录,此次升级可能出现购买后才可以下载的提示!!!<br>升级后可能出现部分冗余数据记录,请根据需要移除即可!!!</p>如有重要数据请备份后再操作!',
+    'Upgrade tips'                   => '确认升级<b>[%s]</b>?<p class="text-danger">升级后可能出现部分冗余数据记录,请根据需要移除即可!!!</p>如有重要数据请备份后再操作!',
     'Offline installed tips'         => '插件安装成功!清除浏览器缓存和框架缓存后生效!',
     'Online installed tips'          => '插件安装成功!清除浏览器缓存和框架缓存后生效!',
     'Not login tips'                 => '你当前未登录FastAdmin,登录后将同步已购买的记录,下载时无需二次付费!',
     'Not installed tips'             => '请安装后再访问插件前台页面!',
     'Not enabled tips'               => '插件已经禁用,请启用后再访问插件前台页面!',
     'New version tips'               => '发现新版本:%s 点击查看更新日志',
-    'Store now available tips'       => 'FastAdmin插件市场暂不可用,是否切换到本地插件?',
+    'Store now available tips'       => '插件市场暂不可用,是否切换到本地插件?',
     'Switch to the local'            => '切换到本地插件',
     'try to reload'                  => '重新尝试加载',
     'Please disable addon first'     => '请先禁用插件再进行升级',
@@ -74,7 +74,7 @@ return [
     'Enable'                         => '启用',
     'Your username or email'         => '你的手机号、用户名或邮箱',
     'Your password'                  => '你的密码',
-    'Login FastAdmin'                => '登录FastAdmin',
+    'Login FastAdmin'                => '登录',
     'Login'                          => '登录',
     'Logout'                         => '退出登录',
     'Register'                       => '注册账号',

+ 0 - 1
application/admin/lang/zh-cn/dashboard.php

@@ -44,5 +44,4 @@ return [
     'Timezone'                => '时区',
     'Language'                => '语言',
     'View more'               => '查看更多',
-    'Security tips'           => '<i class="fa fa-warning"></i> 安全提示:你正在使用默认的后台登录入口,为了你的网站安全,强烈建议你修改后台登录入口,<a href="https://forum.fastadmin.net/thread/7640" target="_blank">点击查看修改方法</a>',
 ];

+ 1 - 0
application/admin/lang/zh-cn/general/config.php

@@ -55,6 +55,7 @@ return [
     'Mail smtp password'          => 'SMTP密码',
     'Mail vertify type'           => 'SMTP验证方式',
     'Mail from'                   => '发件人邮箱',
+    'Site name incorrect'         => '网站名称错误',
     'Name already exist'          => '变量名称已经存在',
     'Add new config'              => '点击添加新的配置',
     'Send a test message'         => '发送测试邮件',

+ 11 - 17
application/admin/view/addon/index.html

@@ -63,11 +63,12 @@
 <div class="panel panel-default panel-intro">
     <div class="panel-heading">
         {:build_heading(null,FALSE)}
+        {if $Think.config.fastadmin.api_url}
         <ul class="nav nav-tabs nav-category">
             <li class="active"><a href="javascript:;" data-id="">{:__('All')}</a></li>
             <li><a href="javascript:;" data-id="0">{:__('Uncategoried')}</a></li>
         </ul>
-
+        {/if}
     </div>
 
     <div class="panel-body">
@@ -76,25 +77,18 @@
                 <div class="widget-body no-padding">
                     <div id="toolbar" class="toolbar">
                         {:build_toolbar('refresh')}
-                        <button type="button" id="plupload-addon" class="btn btn-danger plupload" data-url="addon/local"
-                                data-mimetype="application/zip" data-multiple="false"><i class="fa fa-upload"></i>
+                        <button type="button" id="plupload-addon" class="btn btn-danger plupload" data-url="addon/local" data-mimetype="application/zip" data-multiple="false"><i class="fa fa-upload"></i>
                             {:__('Offline install')}
                         </button>
+                        {if $Think.config.fastadmin.api_url}
                         <div class="btn-group">
-                            <a href="#" class="btn btn-info btn-switch active" data-type="all"
-                               data-url="{$config.fastadmin.api_url}/addon/index"><i class="fa fa-list"></i>
-                                {:__('All')}</a>
-                            <a href="#" class="btn btn-info btn-switch" data-type="free"
-                               data-url="{$config.fastadmin.api_url}/addon/index"><i class="fa fa-gift"></i>
-                                {:__('Free')}</a>
-                            <a href="#" class="btn btn-info btn-switch" data-type="price"
-                               data-url="{$config.fastadmin.api_url}/addon/index"><i class="fa fa-rmb"></i>
-                                {:__('Paying')}</a>
-                            <a href="#" class="btn btn-info btn-switch" data-type="local" data-url="addon/downloaded"><i
-                                    class="fa fa-laptop"></i> {:__('Local addon')}</a>
+                            <a href="#" class="btn btn-info btn-switch active" data-type="all"><i class="fa fa-list"></i> {:__('All')}</a>
+                            <a href="#" class="btn btn-info btn-switch" data-type="free"><i class="fa fa-gift"></i> {:__('Free')}</a>
+                            <a href="#" class="btn btn-info btn-switch" data-type="price"><i class="fa fa-rmb"></i> {:__('Paying')}</a>
+                            <a href="#" class="btn btn-info btn-switch" data-type="local" data-url="addon/downloaded"><i class="fa fa-laptop"></i> {:__('Local addon')}</a>
                         </div>
-                        <a class="btn btn-primary btn-userinfo" href="javascript:;"><i class="fa fa-user"></i>
-                            {:__('Userinfo')}</a>
+                        <a class="btn btn-primary btn-userinfo" href="javascript:;"><i class="fa fa-user"></i> {:__('Userinfo')}</a>
+                        {/if}
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover" width="100%">
 
@@ -135,7 +129,7 @@
                     <div class="form-group">
                         <label class="control-label">{:__('Version')}</label>
                         <input type="hidden" class="operate" data-name="faversion" value="="/>
-                        <input class="form-control" name="faversion" type="text" value="{$config.fastadmin.version}">
+                        <input class="form-control" name="faversion" type="text" value="{$Think.config.fastadmin.version}">
                     </div>
                 </div>
                 <div class="col-xs-12 col-sm-6 col-md-3">

+ 2 - 2
application/admin/view/auth/adminlog/detail.html

@@ -9,7 +9,7 @@
         {volist name="row" id="vo"  }
             <tr>
                 <td>{:__($key)}</td>
-                <td>{$vo|htmlentities}</td>
+                <td>{if $key=='createtime'}{$vo|datetime}{else/}{$vo|htmlentities}{/if}</td>
             </tr>
         {/volist}
     </tbody>
@@ -19,4 +19,4 @@
     <div class="col-xs-12 col-sm-8">
         <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button>
     </div>
-</div>
+</div>

+ 1 - 22
application/admin/view/common/header.html

@@ -28,13 +28,6 @@
                     <a href="__PUBLIC__" target="_blank"><i class="fa fa-home" style="font-size:14px;"></i></a>
                 </li>
 
-                <!-- 账号信息下拉框 -->
-                <li class="hidden-xs">
-                    <a href="javascript:;" data-toggle="checkupdate" title="{:__('Check for updates')}">
-                        <i class="fa fa-refresh"></i>
-                    </a>
-                </li>
-
                 <!-- 清除缓存 -->
                 <li>
                     <a href="javascript:;" data-toggle="dropdown" title="{:__('Wipe cache')}">
@@ -85,20 +78,6 @@
                                 <small>{$admin.logintime|date="Y-m-d H:i:s",###}</small>
                             </p>
                         </li>
-                        <!-- Menu Body -->
-                        <li class="user-body">
-                            <div class="row">
-                                <div class="col-xs-4 text-center">
-                                    <a href="https://www.fastadmin.net" target="_blank">{:__('FastAdmin')}</a>
-                                </div>
-                                <div class="col-xs-4 text-center">
-                                    <a href="https://forum.fastadmin.net" target="_blank">{:__('Forum')}</a>
-                                </div>
-                                <div class="col-xs-4 text-center">
-                                    <a href="https://doc.fastadmin.net" target="_blank">{:__('Docs')}</a>
-                                </div>
-                            </div>
-                        </li>
                         <!-- Menu Footer-->
                         <li class="user-footer">
                             <div class="pull-left">
@@ -120,7 +99,7 @@
         </div>
     </div>
 
-    {if $config.fastadmin.multiplenav}
+    {if $Think.config.fastadmin.multiplenav}
     <!--第二级菜单,只有在multiplenav开启时才显示-->
     <div id="secondnav">
         <ul class="nav nav-tabs nav-addtabs disable-top-badge" role="tablist">

+ 1 - 6
application/admin/view/common/menu.html

@@ -30,15 +30,10 @@
     </div>
 
     <!--如果想始终显示子菜单,则给ul加上show-submenu类即可,当multiplenav开启的情况下默认为展开-->
-    <ul class="sidebar-menu {if $config.fastadmin.multiplenav}show-submenu{/if}">
+    <ul class="sidebar-menu {if $Think.config.fastadmin.multiplenav}show-submenu{/if}">
 
         <!-- 菜单可以在 后台管理->权限管理->菜单规则 中进行增删改排序 -->
         {$menulist}
 
-        <!--以下4行可以删除或改成自己的链接,但建议你在你的网站上添加一个FastAdmin的链接-->
-        <li class="header" data-rel="external">{:__('Links')}</li>
-        <li data-rel="external"><a href="https://doc.fastadmin.net" target="_blank"><i class="fa fa-list text-red"></i> <span>{:__('Docs')}</span></a></li>
-        <li data-rel="external"><a href="https://forum.fastadmin.net" target="_blank"><i class="fa fa-comment text-yellow"></i> <span>{:__('Forum')}</span></a></li>
-        <li data-rel="external"><a href="https://jq.qq.com/?_wv=1027&k=487PNBb" target="_blank"><i class="fa fa-qq text-aqua"></i> <span>{:__('QQ qun')}</span></a></li>
     </ul>
 </section>

+ 0 - 122
application/admin/view/dashboard/index.html

@@ -150,11 +150,6 @@
         padding: 30px 0;
     }
 </style>
-{if preg_match('/\/admin\/|admin\.php|admin_d75KABNWt\.php/i', url())}
-<div class="alert alert-danger-light">
-    {:__('Security tips')}
-</div>
-{/if}
 <div class="panel panel-default panel-intro">
     <div class="panel-heading">
         {:build_heading(null, false)}
@@ -370,123 +365,6 @@
                         </div>
                     </div>
                 </div>
-
-                <div class="row">
-                    <div class="col-lg-4">
-                        <div class="box box-danger">
-                            <div class="box-header with-border">
-                                <h3 class="box-title">{:__('Recent news')}</h3>
-
-                                <div class="box-tools pull-right">
-                                </div>
-                            </div>
-                            <div class="box-body">
-                                <ul class="products-list product-list-in-box">
-                                    {for start="1" end="8"}
-                                    <li class="item">
-                                        <div class="product-img">
-                                            <img src="__CDN__/assets/img/avatar.png" style="height:40px;width:40px;">
-                                        </div>
-                                        <div class="product-info">
-                                            <a href="https://www.fastadmin.net" target="_blank" class="product-title">
-                                                FastAdmin
-                                                <span class="label label-{:$i%3===0?'warning':($i%2===0?'success':'info')} pull-right">开源免费</span>
-                                            </a>
-                                            <span class="product-description">
-                                              一款基于ThinkPHP5+Bootstrap的极速后台开发框架
-                                            </span>
-                                        </div>
-                                    </li>
-                                    {/for}
-                                </ul>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="col-lg-4">
-                        <div class="box box-success">
-                            <div class="box-header with-border">
-                                <h3 class="box-title">{:__('Recent discussion')}</h3>
-
-                                <div class="box-tools pull-right">
-                                </div>
-                            </div>
-                            <div class="box-body">
-                                <ul class="nav nav-pills nav-stacked">
-                                    <li><a href="https://www.fastadmin.net" target="_blank">一款基于ThinkPHP5+Bootstrap的极速后台开发框架<span class="pull-right text-red"><i class="fa fa-angle-down"></i> 12%</span></a></li>
-                                    <li><a href="https://www.fastadmin.net" target="_blank">一键生成CRUD控制器模型和视图 <span class="pull-right text-green"><i class="fa fa-angle-up"></i> 4%</span></a></li>
-                                    <li><a href="https://www.fastadmin.net" target="_blank">一键压缩打包JS和CSS文件 <span class="pull-right text-red"><i class="fa fa-angle-down"></i> 3%</span></a></li>
-                                    <li><a href="https://www.fastadmin.net" target="_blank">一键生成控制器菜单和规则 <span class="pull-right text-green"><i class="fa fa-angle-up"></i> 8%</span></a></li>
-                                    <li><a href="https://www.fastadmin.net" target="_blank">一键生成API接口文档 <span class="pull-right text-yellow"><i class="fa fa-angle-left"></i> 0%</span></a></li>
-                                    <li><a href="https://www.fastadmin.net" target="_blank">强大的插件扩展功能,在线安装卸载升级插件 <span class="pull-right text-red"><i class="fa fa-angle-down"></i> 10%</span></a></li>
-                                    <li><a href="https://www.fastadmin.net" target="_blank">通用的会员模块和API模块 <span class="pull-right text-green"><i class="fa fa-angle-up"></i> 2%</span></a></li>
-                                    <li><a href="https://www.fastadmin.net" target="_blank">共用同一账号体系的Web端会员中心权限验证和API接口会员权限验证 <span class="pull-right text-red"><i class="fa fa-angle-down"></i> 6%</span></a></li>
-                                    <li><a href="https://www.fastadmin.net" target="_blank">二级域名部署支持,同时域名支持绑定到插件 <span class="pull-right text-yellow"><i class="fa fa-angle-left"></i> 0%</span></a></li>
-                                    <li><a href="https://www.fastadmin.net" target="_blank">多语言支持,服务端及客户端支持 <span class="pull-right text-yellow"><i class="fa fa-angle-left"></i> 0%</span></a></li>
-                                    <li><a href="https://www.fastadmin.net" target="_blank">基于Bootstrap开发,自适应手机、平板、PC <span class="pull-right text-green"><i class="fa fa-angle-up"></i> 4%</span></a></li>
-                                </ul>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="col-lg-4">
-                        <div class="box box-info">
-                            <div class="box-header"><h3 class="box-title">{:__('Server info')}</h3></div>
-                            <div class="box-body" style="padding-top:0;">
-                                <table class="table table-striped">
-                                    <tbody>
-                                    <tr>
-                                        <td width="140">{:__('FastAdmin version')}</td>
-                                        <td>{$Think.config.fastadmin.version} <a href="javascript:;" class="btn btn-xs btn-checkversion">检查最新版</a></td>
-                                    </tr>
-                                    <tr>
-                                        <td>{:__('FastAdmin addon version')}</td>
-                                        <td>{$addonversion}</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{:__('Thinkphp version')}</td>
-                                        <td>{:THINK_VERSION}</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{:__('Sapi name')}</td>
-                                        <td>{:php_sapi_name()}</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{:__('Debug mode')}</td>
-                                        <td>{$Think.config.app_debug?__('Yes'):__('No')}</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{:__('Software')}</td>
-                                        <td>{$Think.server.SERVER_SOFTWARE}</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{:__('Upload mode')}</td>
-                                        <td>{$uploadmode}</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{:__('Upload url')}</td>
-                                        <td>{$config.upload.uploadurl}</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{:__('Upload Cdn url')}</td>
-                                        <td>{$config.upload.cdnurl}</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{:__('Timezone')}</td>
-                                        <td>{:date_default_timezone_get()}</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{:__('Cdn url')}</td>
-                                        <td>__CDN__</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{:__('Language')}</td>
-                                        <td>{$config.language}</td>
-                                    </tr>
-                                    </tbody>
-                                </table>
-                            </div>
-                        </div>
-                    </div>
-                </div>
             </div>
             <div class="tab-pane fade" id="two">
                 <div class="row">

+ 3 - 3
application/admin/view/general/attachment/edit.html

@@ -3,7 +3,7 @@
     <div class="form-group">
         <label for="c-url" class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input type="text" name="row[url]" value="{$row.url}"  id="c-url" class="form-control" required />
+            <input type="text" name="row[url]" value="{$row.url|htmlentities}"  id="c-url" class="form-control" required />
         </div>
     </div>
     <div class="form-group">
@@ -21,7 +21,7 @@
     <div class="form-group">
         <label for="c-imagetype" class="control-label col-xs-12 col-sm-2">{:__('Imagetype')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input type="text" name="row[imagetype]" value="{$row.imagetype}"  id="c-imagetype" class="form-control" required />
+            <input type="text" name="row[imagetype]" value="{$row.imagetype|htmlentities}"  id="c-imagetype" class="form-control" required />
         </div>
     </div>
     <div class="form-group">
@@ -39,7 +39,7 @@
     <div class="form-group">
         <label for="c-mimetype" class="control-label col-xs-12 col-sm-2">{:__('Mimetype')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input type="text" name="row[mimetype]" value="{$row.mimetype}"  id="c-mimetype" class="form-control" />
+            <input type="text" name="row[mimetype]" value="{$row.mimetype|htmlentities}"  id="c-mimetype" class="form-control" />
         </div>
     </div>
     <div class="form-group">

+ 11 - 2
application/admin/view/general/attachment/index.html

@@ -1,12 +1,21 @@
 <div class="panel panel-default panel-intro">
-    {:build_heading()}
+
+    <div class="panel-heading">
+        {:build_heading(null,FALSE)}
+        <ul class="nav nav-tabs" data-field="mimetype">
+            <li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
+            {foreach name="mimetypeList" item="vo"}
+            <li><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
+            {/foreach}
+        </ul>
+    </div>
 
     <div class="panel-body">
         <div id="myTabContent" class="tab-content">
             <div class="tab-pane fade active in" id="one">
                 <div class="widget-body no-padding">
                     <div id="toolbar" class="toolbar">
-                        {:build_toolbar()}
+                        {:build_toolbar('refresh,add,edit,del')}
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover" width="100%">
                     </table>

+ 11 - 1
application/admin/view/general/attachment/select.html

@@ -1,5 +1,15 @@
 <div class="panel panel-default panel-intro">
-    {:build_heading()}
+    {if !$Think.get.mimetype}
+    <div class="panel-heading">
+        {:build_heading(null,FALSE)}
+        <ul class="nav nav-tabs" data-field="mimetype">
+            <li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
+            {foreach name="mimetypeList" item="vo"}
+            <li><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
+            {/foreach}
+        </ul>
+    </div>
+    {/if}
 
     <div class="panel-body">
         <div id="myTabContent" class="tab-content">

+ 1 - 1
application/admin/view/general/config/index.html

@@ -146,7 +146,7 @@
 
                                 </td>
                                 <td>{php}echo "{\$site.". $item['name'] . "}";{/php}</td>
-                                <td><a href="javascript:;" class="btn-delcfg text-muted" data-name="{$item.name}"><i class="fa fa-times"></i></a></td>
+                                <td>{if $item['id']>17}<a href="javascript:;" class="btn-delcfg text-muted" data-name="{$item.name}"><i class="fa fa-times"></i></a>{/if}</td>
                             </tr>
                             {/foreach}
                             </tbody>

+ 2 - 2
application/admin/view/index/index.html

@@ -4,7 +4,7 @@
         <!-- 加载样式及META信息 -->
         {include file="common/meta" /}
     </head>
-    <body class="hold-transition skin-green sidebar-mini fixed {if $config.fastadmin.multiplenav}multiplenav{/if}" id="tabs">
+    <body class="hold-transition skin-green sidebar-mini fixed {if $Think.config.fastadmin.multiplenav}multiplenav{/if}" id="tabs">
         <div class="wrapper">
 
             <!-- 头部区域 -->
@@ -35,7 +35,7 @@
             <footer class="main-footer hide">
                 <div class="pull-right hidden-xs">
                 </div>
-                <strong>Copyright &copy; 2017-2018 <a href="https://www.fastadmin.net">Fastadmin</a>.</strong> All rights reserved.
+                <strong>Copyright &copy; 2017-2020 <a href="__PUBLIC__">{$site.name}</a>.</strong> All rights reserved.
             </footer>
 
             <!-- 右侧控制栏 -->

+ 1 - 3
application/admin/view/index/login.html

@@ -76,7 +76,7 @@
                                     <div class="input-group-addon"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span></div>
                                     <input type="password" class="form-control" id="pd-form-password" placeholder="{:__('Password')}" name="password" autocomplete="off" value="" data-rule="{:__('Password')}:required;password" />
                                 </div>
-                                {if $config.fastadmin.login_captcha}
+                                {if $Think.config.fastadmin.login_captcha}
                                 <div class="input-group">
                                     <div class="input-group-addon"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></div>
                                     <input type="text" name="captcha" class="form-control" placeholder="{:__('Captcha')}" data-rule="{:__('Captcha')}:required;length(4)" />
@@ -97,8 +97,6 @@
                             </form>
                         </div>
                     </div>
-                    <!-- FastAdmin是开源程序,建议在您的网站底部保留一个FastAdmin的链接 -->
-                    <p class="copyright"><a href="https://www.fastadmin.net">Powered By FastAdmin</a></p>
                 </div>
             </div>
         </div>

+ 1 - 1
application/admin/view/layout/default.html

@@ -16,7 +16,7 @@
                                     <small>{:__('Control panel')}</small>
                                 </h1>
                             </section>
-                            {if !IS_DIALOG && !$config.fastadmin.multiplenav}
+                            {if !IS_DIALOG && !$Think.config.fastadmin.multiplenav}
                             <!-- RIBBON -->
                             <div id="ribbon">
                                 <ol class="breadcrumb pull-left">

+ 1 - 0
application/common/controller/Api.php

@@ -164,6 +164,7 @@ class Api
      */
     protected function loadlang($name)
     {
+        $name =  Loader::parseName($name);
         Lang::load(APP_PATH . $this->request->module() . '/lang/' . $this->request->langset() . '/' . str_replace('.', '/', $name) . '.php');
     }
 

+ 1 - 2
application/common/controller/Backend.php

@@ -202,7 +202,6 @@ class Backend extends Controller
             'jsname'         => 'backend/' . str_replace('.', '/', $controllername),
             'moduleurl'      => rtrim(url("/{$modulename}", '', false), '/'),
             'language'       => $lang,
-            'fastadmin'      => Config::get('fastadmin'),
             'referer'        => Session::get("referer")
         ];
         $config = array_merge($config, Config::get("view_replace_str"));
@@ -452,7 +451,7 @@ class Backend extends Controller
         //如果有primaryvalue,说明当前是初始化传值
         if ($primaryvalue !== null) {
             $where = [$primarykey => ['in', $primaryvalue]];
-            $pagesize = null;
+            $pagesize = 99999;
         } else {
             $where = function ($query) use ($word, $andor, $field, $searchfield, $custom) {
                 $logic = $andor == 'AND' ? '&' : '|';

+ 1 - 0
application/common/controller/Frontend.php

@@ -123,6 +123,7 @@ class Frontend extends Controller
      */
     protected function loadlang($name)
     {
+        $name =  Loader::parseName($name);
         Lang::load(APP_PATH . $this->request->module() . '/lang/' . $this->request->langset() . '/' . str_replace('.', '/', $name) . '.php');
     }
 

+ 13 - 0
application/common/model/Attachment.php

@@ -21,6 +21,19 @@ class Attachment extends Model
         return is_numeric($value) ? $value : strtotime($value);
     }
 
+    public static function getMimetypeList()
+    {
+        $data = [
+            "image/*"        => "图片",
+            "audio/*"        => "音频",
+            "video/*"        => "视频",
+            "text/*"         => "文档",
+            "application/*"  => "应用",
+            "zip,rar,7z,tar" => "压缩包",
+        ];
+        return $data;
+    }
+
     protected static function init()
     {
         // 如果已经上传该资源,则不再记录

+ 0 - 3
application/common/view/tpl/dispatch_jump.tpl

@@ -45,9 +45,6 @@
         {/if}
     </p>
 </div>
-<div class="copyright">
-    <p>Powered by <a href="https://www.fastadmin.net/?ref=jump">FastAdmin</a></p>
-</div>
 {if $url}
     <script type="text/javascript">
         (function () {

+ 1 - 1
application/config.php

@@ -276,7 +276,7 @@ return [
         //自动检测更新
         'checkupdate'           => false,
         //版本号
-        'version'               => '1.0.0.20191212_beta',
+        'version'               => '1.0.0.20200228_beta',
         //API接口地址
         'api_url'               => 'https://api.fastadmin.net',
     ],

+ 1 - 1
application/database.php

@@ -34,7 +34,7 @@ return [
     // 数据库表前缀
     'prefix'          => Env::get('database.prefix', 'fa_'),
     // 数据库调试模式
-    'debug'           => Env::get('database.debug', true),
+    'debug'           => Env::get('database.debug', false),
     // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
     'deploy'          => 0,
     // 数据库读写是否分离 主从式有效

+ 1 - 1
application/extra/site.php

@@ -1,7 +1,7 @@
 <?php
 
 return array (
-  'name' => 'FastAdmin',
+  'name' => '我的网站',
   'beian' => '',
   'cdnurl' => '',
   'version' => '1.0.1',

+ 7 - 2
application/index/controller/Ajax.php

@@ -22,14 +22,19 @@ class Ajax extends Frontend
     public function lang()
     {
         header('Content-Type: application/javascript');
-        $callback = $this->request->get('callback');
+        header("Cache-Control: public");
+        header("Pragma: cache");
+
+        $offset = 30 * 60 * 60 * 24; // 缓存一个月
+        header("Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT");
+
         $controllername = input("controllername");
         $this->loadlang($controllername);
         //强制输出JSON Object
         $result = jsonp(Lang::get(), 200, [], ['json_encode_param' => JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE]);
         return $result;
     }
-    
+
     /**
      * 上传文件
      */

+ 0 - 6
application/index/controller/Index.php

@@ -16,10 +16,4 @@ class Index extends Frontend
         return $this->view->fetch();
     }
 
-    public function news()
-    {
-        $newslist = [];
-        return jsonp(['newslist' => $newslist, 'new' => count($newslist), 'url' => 'https://www.fastadmin.net?ref=news']);
-    }
-
 }

+ 1 - 9
application/index/lang/en/index.php

@@ -1,13 +1,5 @@
 <?php
 
 return [
-    'Title'           => 'Title',
-    'Auth tips'       => 'Unlimited parent-child permission grouping, administrator can belong to multiple groups at the same time',
-    'Responsive tips' => 'Based on Bootstrap and AdminLTE, mobile phones, tablets, PCs are automatically adapted',
-    'Languages tips'  => 'Backend and Frontend support, View and JS share the same language package',
-    'Module tips'     => 'RequireJS and Bower for frontend package component management,Composer for backend package component management',
-    'CRUD tips'       => 'One key to generate a controller, model, view and JS file, one key to generate an API document and auth rule',
-    'Extension tips'  => 'Installed and uninstalled directly online plug-in, supporting the command line one key operation',
-    'Do not hesitate' => 'Do not hesitate',
-    'Start to act'    => 'Start Action',
+
 ];

+ 1 - 3
application/index/lang/zh-cn.php

@@ -86,9 +86,7 @@ return [
     'Gitee'                                                  => '码云',
     'Github'                                                 => 'Github',
     'QQ group'                                               => 'QQ群',
-    'Go to Dashboard'                                        => '登录后台',
-    'Go to Member center'                                    => '会员中心',
-    'Contribution'                                           => '为FastAdmin贡献代码!',
+    'Member center'                                          => '会员中心',
     'Copyrights'                                             => '版权所有',
     'Responsive'                                             => '响应式开发',
     'Languages'                                              => '多语言',

+ 1 - 10
application/index/lang/zh-cn/index.php

@@ -1,14 +1,5 @@
 <?php
 
 return [
-    'Title'           => '标题',
-    'CRUD'            => '一键CRUD',
-    'Auth tips'       => '基于完善的Auth权限控制管理、无限父子级权限分组、可自由分配子级权限、一个管理员可同时属于多个组别',
-    'Responsive tips' => '基于Bootstrap和AdminLTE进行二次开发,手机、平板、PC均自动适配,无需要担心兼容性问题',
-    'Languages tips'  => '不仅仅后台开发支持多语言,同时视图部分和JS部分仍然共享同一个语言包,语法相同且自动加载',
-    'Module tips'     => '控制器、模型、视图、JS一一对应,使用RequireJS进行JS模块化管理,采用Bower进行前端包组件管理',
-    'CRUD tips'       => '可使用命令行一键生成控制器、模型、视图和JS文件,一键生成API文档,一键生成回收站,一键生成后台权限节点和菜单栏',
-    'Extension tips'  => 'FastAdmin提供强大丰富的应用(插件)市场,可直接在线安装和卸载用户(插件),同时支持命令行一键操作',
-    'Do not hesitate' => '不要犹豫',
-    'Start to act'    => '开始行动',
+
 ];

+ 1 - 1
application/index/view/common/captcha.html

@@ -16,7 +16,7 @@
             <a href="javascript:;" class="btn btn-info btn-captcha btn-lg" data-url="{:addon_url('wechat/captcha/send')}" data-type="wechat" data-event="[event]">获取验证码</a>
         </span>
     {else/}
-        请在后台插件管理中安装《<a href="https://www.fastadmin.net/store/wechat.html" target="_blank">微信管理插件</a>
+        请在后台插件管理中安装《微信管理插件》
     {/if}
 {elseif "[type]" == 'text' /}
     <input type="text" name="captcha" class="form-control input-lg" data-rule="required;length(4)" />

+ 1 - 2
application/index/view/common/meta.html

@@ -1,5 +1,5 @@
 <meta charset="utf-8">
-<title>{$title|default=''} – {:__('The fastest framework based on ThinkPHP5 and Bootstrap')}</title>
+<title>{$title|default=''} – {$site.name}</title>
 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
 <meta name="renderer" content="webkit">
 
@@ -9,7 +9,6 @@
 {if isset($description)}
 <meta name="description" content="{$description}">
 {/if}
-<meta name="author" content="FastAdmin">
 
 <link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" />
 

+ 1 - 1
application/index/view/common/sidenav.html

@@ -1,7 +1,7 @@
 <div class="sidenav">
     {:hook('user_sidenav_before')}
     <ul class="list-group">
-        <li class="list-group-heading">{:__('User center')}</li>
+        <li class="list-group-heading">{:__('Member center')}</li>
         <li class="list-group-item {:$config['actionname']=='index'?'active':''}"> <a href="{:url('user/index')}"><i class="fa fa-user-circle fa-fw"></i> {:__('User center')}</a> </li>
         <li class="list-group-item {:$config['actionname']=='profile'?'active':''}"> <a href="{:url('user/profile')}"><i class="fa fa-user-o fa-fw"></i> {:__('Profile')}</a> </li>
         <li class="list-group-item {:$config['actionname']=='changepwd'?'active':''}"> <a href="{:url('user/changepwd')}"><i class="fa fa-key fa-fw"></i> {:__('Change password')}</a> </li>

+ 6 - 128
application/index/view/index/index.html

@@ -9,7 +9,7 @@
         <meta name="description" content="">
         <meta name="author" content="">
 
-        <title>FastAdmin - {:__('The fastest framework based on ThinkPHP5 and Bootstrap')}</title>
+        <title>{$site.name}</title>
 
         <!-- Bootstrap Core CSS -->
         <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
@@ -34,20 +34,13 @@
                     <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-menu">
                         <span class="sr-only">Toggle navigation</span><i class="fa fa-bars"></i>
                     </button>
-                    <a class="navbar-brand page-scroll" href="#page-top"><img src="__CDN__/assets/img/logo.png" style="width:200px;" alt=""></a>
+                    <a class="navbar-brand page-scroll" href="#page-top">{$site.name}</a>
                 </div>
 
                 <div class="collapse navbar-collapse" id="navbar-collapse-menu">
                     <ul class="nav navbar-nav navbar-right">
-                        <li><a href="https://www.fastadmin.net" target="_blank">{:__('Home')}</a></li>
-                        <li><a href="https://www.fastadmin.net/store.html" target="_blank">{:__('Store')}</a></li>
-                        <li><a href="https://www.fastadmin.net/wxapp.html" target="_blank">{:__('Wxapp')}</a></li>
-                        <li><a href="https://www.fastadmin.net/service.html" target="_blank">{:__('Services')}</a></li>
-                        <li><a href="https://www.fastadmin.net/download.html" target="_blank">{:__('Download')}</a></li>
-                        <li><a href="https://www.fastadmin.net/demo.html" target="_blank">{:__('Demo')}</a></li>
-                        <li><a href="https://www.fastadmin.net/donate.html" target="_blank">{:__('Donation')}</a></li>
-                        <li><a href="https://forum.fastadmin.net" target="_blank">{:__('Forum')}</a></li>
-                        <li><a href="https://doc.fastadmin.net" target="_blank">{:__('Docs')}</a></li>
+                        <li><a href="{:url('/')}" target="_blank">{:__('Home')}</a></li>
+                        <li><a href="{:url('index/user/index')}" target="_blank">{:__('Member center')}</a></li>
                     </ul>
                 </div>
                 <!-- /.navbar-collapse -->
@@ -61,9 +54,7 @@
                     <div class="col-sm-12">
                         <div class="header-content">
                             <div class="header-content-inner">
-                                <h1>FastAdmin</h1>
-                                <h3>{:__('The fastest framework based on ThinkPHP5 and Bootstrap')}</h3>
-                                <a href="{:url('index/user/index')}" class="btn btn-outline btn-xl page-scroll">{:__('Go to Member center')}</a>
+                                <h1>{$site.name}</h1>
                             </div>
                         </div>
                     </div>
@@ -71,124 +62,11 @@
             </div>
         </header>
 
-        <section id="features" class="features">
-            <div class="container">
-                <div class="row">
-                    <div class="col-lg-12 text-center">
-                        <div class="section-heading">
-                            <h2>{:__('Features')}</h2>
-                        </div>
-                    </div>
-                </div>
-                <div class="row">
-                    <div class="col-md-12">
-                        <div class="container-fluid">
-                            <div class="row">
-                                <div class="col-md-4">
-                                    <div class="feature-item">
-                                        <i class="icon-user text-primary"></i>
-                                        <h3>{:__('Auth')}</h3>
-                                        <p class="text-muted">{:__('Auth tips')}</p>
-                                    </div>
-                                </div>
-                                <div class="col-md-4">
-                                    <div class="feature-item">
-                                        <i class="icon-screen-smartphone text-primary"></i>
-                                        <h3>{:__('Responsive')}</h3>
-                                        <p class="text-muted">{:__('Responsive tips')}</p>
-                                    </div>
-                                </div>
-                                <div class="col-md-4">
-                                    <div class="feature-item">
-                                        <i class="icon-present text-primary"></i>
-                                        <h3>{:__('Languages')}</h3>
-                                        <p class="text-muted">{:__('Languages tips')}</p>
-                                    </div>
-                                </div>
-                                <div class="col-md-4">
-                                    <div class="feature-item">
-                                        <i class="icon-layers text-primary"></i>
-                                        <h3>{:__('Module')}</h3>
-                                        <p class="text-muted">{:__('Module tips')}</p>
-                                    </div>
-                                </div>
-                                <div class="col-md-4">
-                                    <div class="feature-item">
-                                        <i class="icon-docs text-primary"></i>
-                                        <h3>{:__('CRUD')}</h3>
-                                        <p class="text-muted">{:__('CRUD tips')}</p>
-                                    </div>
-                                </div>
-                                <div class="col-md-4">
-                                    <div class="feature-item">
-                                        <i class="icon-puzzle text-primary"></i>
-                                        <h3>{:__('Extension')}</h3>
-                                        <p class="text-muted">{:__('Extension tips')}</p>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </section>
-
-        <section class="cta">
-            <div class="cta-content">
-                <div class="container">
-                    <h2>{:__('Do not hesitate')}<br>{:__('Start to act')}</h2>
-                    <a href="https://doc.fastadmin.net/docs/contributing.html" class="btn btn-outline btn-xl page-scroll">{:__('Contribution')}</a>
-                </div>
-            </div>
-            <div class="overlay"></div>
-        </section>
-
-        <footer>
-            <div class="container">
-                <!-- FastAdmin是开源程序,建议在您的网站底部保留一个FastAdmin的链接 -->
-                <p>&copy; 2017-2019 <a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>. All Rights Reserved.</p>
-                <ul class="list-inline">
-                    <li>
-                        <a href="https://gitee.com/karson/fastadmin">{:__('Gitee')}</a>
-                    </li>
-                    <li>
-                        <a href="https://github.com/karsonzhang/fastadmin">{:__('Github')}</a>
-                    </li>
-                    <li>
-                        <a href="https://shang.qq.com/wpa/qunwpa?idkey=46c326e570d0f97cfae1f8257ae82322192ec8841c79b2136446df0b3b62028c">{:__('QQ group')}</a>
-                    </li>
-                </ul>
-            </div>
-        </footer>
-
         <!-- jQuery -->
         <script src=https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js></script>
 
         <!-- Bootstrap Core JavaScript -->
         <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
-
-        <!-- Plugin JavaScript -->
-        <script src="https://cdn.staticfile.org/jquery-easing/1.4.1/jquery.easing.min.js"></script>
-
-        <script>
-            $(function () {
-                $(window).on("scroll", function () {
-                    $("#mainNav").toggleClass("affix", $(window).height() - $(window).scrollTop() <= 50);
-                });
-            });
-        </script>
-
-        <script>
-            // FastAdmin统计代码,请移除
-            var _hmt = _hmt || [];
-            (function () {
-                var hm = document.createElement("script");
-                hm.src = "https://hm.baidu.com/hm.js?f8d0a8c400404989e195270b0bbf060a";
-                var s = document.getElementsByTagName("script")[0];
-                s.parentNode.insertBefore(hm, s);
-            })();
-        </script>
-
     </body>
 
-</html>
+</html>

+ 3 - 12
application/index/view/layout/default.html

@@ -16,19 +16,11 @@
                         <span class="icon-bar"></span>
                         <span class="icon-bar"></span>
                     </button>
-                    <a class="navbar-brand" href="{:url('/')}" style="padding:6px 15px;"><img src="__CDN__/assets/img/logo.png" style="height:40px;" alt=""></a>
+                    <a class="navbar-brand" href="{:url('/')}">{$site.name}</a>
                 </div>
                 <div class="collapse navbar-collapse" id="header-navbar">
                     <ul class="nav navbar-nav navbar-right">
-                        <li><a href="https://www.fastadmin.net" target="_blank">{:__('Home')}</a></li>
-                        <li><a href="https://www.fastadmin.net/store.html" target="_blank">{:__('Store')}</a></li>
-                        <li><a href="https://www.fastadmin.net/wxapp.html" target="_blank">{:__('Wxapp')}</a></li>
-                        <li><a href="https://www.fastadmin.net/service.html" target="_blank">{:__('Services')}</a></li>
-                        <li><a href="https://www.fastadmin.net/download.html" target="_blank">{:__('Download')}</a></li>
-                        <li><a href="https://www.fastadmin.net/demo.html" target="_blank">{:__('Demo')}</a></li>
-                        <li><a href="https://www.fastadmin.net/donate.html" target="_blank">{:__('Donation')}</a></li>
-                        <li><a href="https://forum.fastadmin.net" target="_blank">{:__('Forum')}</a></li>
-                        <li><a href="https://doc.fastadmin.net" target="_blank">{:__('Docs')}</a></li>
+                        <li><a href="{:url('/')}" target="_blank">{:__('Home')}</a></li>
                         <li class="dropdown">
                             {if $user}
                             <a href="{:url('user/index')}" class="dropdown-toggle" data-toggle="dropdown" style="padding-top: 10px;height: 50px;">
@@ -60,8 +52,7 @@
         </main>
 
         <footer class="footer" style="clear:both">
-            <!-- FastAdmin是开源程序,建议在您的网站底部保留一个FastAdmin的链接 -->
-            <p class="copyright">Copyright&nbsp;©&nbsp;2017-2019 Powered by <a href="https://www.fastadmin.net" target="_blank">FastAdmin</a> All Rights Reserved <a href="http://www.beian.miit.gov.cn" target="_blank">{$site.beian|htmlentities}</a></p>
+            <p class="copyright">Copyright&nbsp;©&nbsp;2017-2020 {$site.name} All Rights Reserved <a href="http://www.beian.miit.gov.cn" target="_blank">{$site.beian|htmlentities}</a></p>
         </footer>
 
         {include file="common/script" /}

+ 1 - 1
application/index/view/user/index.html

@@ -20,7 +20,7 @@
             <div class="panel panel-default ">
                 <div class="panel-body">
                     <h2 class="page-header">
-                        {:__('User center')}
+                        {:__('Member center')}
                         <a href="{:url('user/profile')}" class="btn btn-success pull-right"><i class="fa fa-pencil"></i>
                             {:__('Profile')}</a>
                     </h2>

+ 1 - 1
public/admin.php

@@ -15,7 +15,7 @@
 // 定义应用目录
 define('APP_PATH', __DIR__ . '/../application/');
 
-// 判断是否安装FastAdmin
+// 判断是否安装
 if (!is_file(APP_PATH . 'admin/command/Install/install.lock'))
 {
     header("location:./install.php");

+ 17 - 8
public/api.html

@@ -5,8 +5,7 @@
         <meta http-equiv="X-UA-Compatible" content="IE=edge">
         <meta name="viewport" content="width=device-width, initial-scale=1.0">
         <meta name="description" content="">
-        <meta name="author" content="FastAdmin">
-        <title>FastAdmin</title>
+        <title>我的网站</title>
 
         <!-- Bootstrap Core CSS -->
         <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
@@ -109,7 +108,7 @@
                         <span class="icon-bar"></span>
                         <span class="icon-bar"></span>
                     </button>
-                    <a class="navbar-brand" href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
+                    <a class="navbar-brand" href="./" target="_blank">我的网站</a>
                 </div>
                 <div class="navbar-collapse collapse">
                     <form class="navbar-form navbar-right">
@@ -2086,6 +2085,12 @@
                                                         <td>是</td>
                                                         <td>手机号</td>
                                                     </tr>
+                                                                                                        <tr>
+                                                        <td>code</td>
+                                                        <td>string</td>
+                                                        <td>是</td>
+                                                        <td>验证码</td>
+                                                    </tr>
                                                                                                     </tbody>
                                             </table>
                                                                                     </div>
@@ -2121,6 +2126,10 @@
                                                             <input type="string" class="form-control input-sm" id="mobile" required placeholder="手机号" name="mobile">
                                                         </div>
                                                                                                                 <div class="form-group">
+                                                            <label class="control-label" for="code">code</label>
+                                                            <input type="string" class="form-control input-sm" id="code" required placeholder="验证码" name="code">
+                                                        </div>
+                                                                                                                <div class="form-group">
                                                             <button type="submit" class="btn btn-success send" rel="16">提交</button>
                                                             <button type="reset" class="btn btn-info" rel="16">重置</button>
                                                         </div>
@@ -2555,7 +2564,7 @@
                                                 </thead>
                                                 <tbody>
                                                                                                         <tr>
-                                                        <td>email</td>
+                                                        <td>mobile</td>
                                                         <td>string</td>
                                                         <td>是</td>
                                                         <td>手机号</td>
@@ -2585,8 +2594,8 @@
                                                 <div class="panel-body">
                                                     <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/changemobile" method="get" name="form20" id="form20">
                                                                                                                 <div class="form-group">
-                                                            <label class="control-label" for="email">email</label>
-                                                            <input type="string" class="form-control input-sm" id="email" required placeholder="手机号" name="email">
+                                                            <label class="control-label" for="mobile">mobile</label>
+                                                            <input type="string" class="form-control input-sm" id="mobile" required placeholder="手机号" name="mobile">
                                                         </div>
                                                                                                                 <div class="form-group">
                                                             <label class="control-label" for="captcha">captcha</label>
@@ -3730,9 +3739,9 @@
 
             <div class="row mt0 footer">
                 <div class="col-md-6" align="left">
-                    Generated on 2019-06-28 12:14:48                </div>
+                    Generated on 2020-02-16 16:01:35                </div>
                 <div class="col-md-6" align="right">
-                    <a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
+                    <a href="./" target="_blank">我的网站</a>
                 </div>
             </div>
 

File diff suppressed because it is too large
+ 1 - 1
public/assets/css/backend.min.css


File diff suppressed because it is too large
+ 1 - 1
public/assets/css/frontend.min.css


+ 2 - 184
public/assets/css/index.css

@@ -43,11 +43,6 @@ p {
     margin-bottom: 20px;
 }
 .navbar-default {
-    background-color: white;
-    border-color: rgba(34, 34, 34, 0.05);
-    -webkit-transition: all 0.35s;
-    -moz-transition: all 0.35s;
-    transition: all 0.35s;
     font-family: 'Catamaran', 'Helvetica', 'Arial', 'sans-serif';
     font-weight: 200;
     letter-spacing: 1px;
@@ -56,7 +51,6 @@ p {
     font-family: 'Catamaran', 'Helvetica', 'Arial', 'sans-serif';
     font-weight: 200;
     letter-spacing: 1px;
-    color: #fdcc52;
 }
 .navbar-default .navbar-header .navbar-brand:hover,
 .navbar-default .navbar-header .navbar-brand:focus {
@@ -72,10 +66,6 @@ p {
     letter-spacing: 2px;
     font-size: 14px;
 }
-.navbar-default .nav > li > a,
-.navbar-default .nav > li > a:focus {
-    color: #222222;
-}
 .navbar-default .nav > li > a:hover,
 .navbar-default .nav > li > a:focus:hover {
     color: #fdcc52;
@@ -89,9 +79,6 @@ p {
 .navbar-default .nav > li.active > a:focus:hover {
     background-color: transparent;
 }
-.navbar-default .navbar-header .navbar-brand {
-    padding-top:3px;
-}
 @media (min-width: 768px) {
     .navbar-default {
         background-color: transparent;
@@ -112,36 +99,17 @@ p {
     .navbar-default .nav > li > a:focus:hover {
         color: white;
     }
-    .navbar-default.affix {
-        background-color: white;
-        border-color: rgba(34, 34, 34, 0.1);
-    }
-    .navbar-default.affix .navbar-header .navbar-brand {
-        color: #222222;
-    }
-    .navbar-default.affix .navbar-header .navbar-brand:hover,
-    .navbar-default.affix .navbar-header .navbar-brand:focus {
-        color: #fdcc52;
-    }
-    .navbar-default.affix .nav > li > a,
-    .navbar-default.affix .nav > li > a:focus {
-        color: #222222;
-    }
-    .navbar-default.affix .nav > li > a:hover,
-    .navbar-default.affix .nav > li > a:focus:hover {
-        color: #fdcc52;
-    }
 }
 header {
     position: relative;
     width: 100%;
     min-height: auto;
     overflow-y: hidden;
-    background: url("../img/bg-pattern.png"), #7b4397;
+    background: url("../img/bg-pattern.png"), #247cdc;
     /* fallback for old browsers */
     background: url("../img/bg-pattern.png"), -webkit-linear-gradient(to left, #328944, #247cdc);
     /* Chrome 10-25, Safari 5.1-6 */
-    background: url(../img/bg-pattern.png), linear-gradient(to left, #328944, #247cdc);
+    background: url("../img/bg-pattern.png"), linear-gradient(to left, #328944, #247cdc);
     /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
     color: white;
 }
@@ -215,153 +183,6 @@ section {
 section h2 {
     font-size: 50px;
 }
-section.download {
-    padding: 150px 0;
-    position: relative;
-}
-section.download h2 {
-    margin-top: 0;
-    font-size: 50px;
-}
-section.download .badges .badge-link {
-    display: block;
-    margin-bottom: 25px;
-}
-section.download .badges .badge-link:last-child {
-    margin-bottom: 0;
-}
-section.download .badges .badge-link img {
-    height: 60px;
-}
-@media (min-width: 768px) {
-    section.download .badges .badge-link {
-        display: inline-block;
-        margin-bottom: 0;
-    }
-}
-@media (min-width: 768px) {
-    section.download h2 {
-        font-size: 70px;
-    }
-}
-section.features .section-heading {
-    margin-bottom: 100px;
-}
-section.features .section-heading h2 {
-    margin-top: 0;
-}
-section.features .section-heading p {
-    margin-bottom: 0;
-}
-section.features .device-container,
-section.features .feature-item {
-    max-width: 300px;
-    margin: 0 auto;
-    height:215px;
-}
-section.features .device-container {
-    margin-bottom: 100px;
-}
-@media (min-width: 992px) {
-    section.features .device-container {
-        margin-bottom: 0;
-    }
-}
-section.features .feature-item {
-    text-align: center;
-    margin-bottom: 80px;
-}
-section.features .feature-item h3 {
-    font-size: 24px;
-}
-section.features .feature-item i {
-    font-size: 60px;
-    
-    background: -webkit-linear-gradient(to left,#328944, #247cdc);
-    background: linear-gradient(to left, #328944, #247cdc);
-    -webkit-background-clip: text;
-    -webkit-text-fill-color: transparent;
-}
-@media (min-width: 992px) {
-    section.features .device-container,
-    section.features .feature-item {
-        max-width: none;
-    }
-}
-section.cta {
-    position: relative;
-    -webkit-background-size: cover;
-    -moz-background-size: cover;
-    background-size: cover;
-    -o-background-size: cover;
-    background-position: center;
-    background-image: url('../img/bg-middle.jpg');
-    padding: 250px 0;
-}
-section.cta .cta-content {
-    position: relative;
-    z-index: 1;
-}
-section.cta .cta-content h2 {
-    margin-top: 0;
-    margin-bottom: 25px;
-    color: white;
-    max-width: 450px;
-    font-size: 50px;
-}
-@media (min-width: 768px) {
-    section.cta .cta-content h2 {
-        font-size: 70px;
-    }
-}
-section.cta .overlay {
-    height: 100%;
-    width: 100%;
-    background-color: rgba(0, 0, 0, 0.5);
-    position: absolute;
-    top: 0;
-    left: 0;
-}
-section.contact {
-    text-align: center;
-}
-section.contact h2 {
-    margin-top: 0;
-    margin-bottom: 25px;
-}
-section.contact h2 i {
-    color: #dd4b39;
-}
-section.contact ul.list-social {
-    margin-bottom: 0;
-}
-section.contact ul.list-social li a {
-    display: block;
-    height: 80px;
-    width: 80px;
-    line-height: 80px;
-    font-size: 40px;
-    border-radius: 100%;
-    color: white;
-}
-section.contact ul.list-social li.social-github a {
-    background-color: #444;
-}
-section.contact ul.list-social li.social-github a:hover {
-    background-color: #111;
-}
-section.contact ul.list-social li.social-qq a {
-    background-color: #1da1f2;
-}
-section.contact ul.list-social li.social-qq a:hover {
-    background-color: #0d95e8;
-}
-section.contact ul.list-social li.social-weibo a {
-    background-color: #dd4b39;
-}
-section.contact ul.list-social li.social-weibo a:hover {
-    background-color: #d73925;
-}
 footer {
     background-color: #222222;
     padding: 25px 0;
@@ -420,6 +241,3 @@ footer ul li a.active {
     padding: 10px 45px;
     font-size: 14px;
 }
-body {
-    webkit-tap-highlight-color: #222222;
-}

BIN
public/assets/img/logo.png


BIN
public/assets/img/logo.psd


+ 9 - 9
public/assets/js/backend/addon.js

@@ -4,7 +4,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
             // 初始化表格参数配置
             Table.api.init({
                 extend: {
-                    index_url: Config.fastadmin.api_url + '/addon/index',
+                    index_url: Config.api_url ? Config.api_url + '/addon/index' : "addon/downloaded",
                     add_url: '',
                     edit_url: '',
                     del_url: '',
@@ -67,7 +67,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
                     $.extend(params, {
                         uid: userinfo ? userinfo.id : '',
                         token: userinfo ? userinfo.token : '',
-                        version: Config.fastadmin.version
+                        version: Config.faversion
                     });
                     return params;
                 },
@@ -183,7 +183,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
                 $(".btn-switch").removeClass("active");
                 $(this).addClass("active");
                 $("form.form-commonsearch input[name='type']").val($(this).data("type"));
-                table.bootstrapTable('refresh', {url: $(this).data("url"), pageNumber: 1});
+                table.bootstrapTable('refresh', {url: ($(this).data("url") ? $(this).data("url") : $.fn.bootstrapTable.defaults.extend.index_url), pageNumber: 1});
                 return false;
             });
             $(document).on("click", ".nav-category li a", function () {
@@ -208,7 +208,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
                         btn: [__('Login'), __('Register')],
                         yes: function (index, layero) {
                             Fast.api.ajax({
-                                url: Config.fastadmin.api_url + '/user/login',
+                                url: Config.api_url + '/user/login',
                                 dataType: 'jsonp',
                                 data: {
                                     account: $("#inputAccount", layero).val(),
@@ -231,7 +231,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
                     });
                 } else {
                     Fast.api.ajax({
-                        url: Config.fastadmin.api_url + '/user/index',
+                        url: Config.api_url + '/user/index',
                         dataType: 'jsonp',
                         data: {
                             user_id: userinfo.id,
@@ -246,7 +246,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
                             btn: [__('Logout'), __('Cancel')],
                             yes: function () {
                                 Fast.api.ajax({
-                                    url: Config.fastadmin.api_url + '/user/logout',
+                                    url: Config.api_url + '/user/logout',
                                     dataType: 'jsonp',
                                     data: {uid: userinfo.id, token: userinfo.token}
                                 }, function (data, ret) {
@@ -282,7 +282,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
                         uid: uid,
                         token: token,
                         version: version,
-                        faversion: Config.fastadmin.version
+                        faversion: Config.faversion
                     }
                 }, function (data, ret) {
                     Layer.closeAll();
@@ -420,7 +420,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
                 var token = userinfo ? userinfo.token : '';
                 Fast.api.ajax({
                     url: 'addon/upgrade',
-                    data: {name: name, uid: uid, token: token, version: version, faversion: Config.fastadmin.version}
+                    data: {name: name, uid: uid, token: token, version: version, faversion: Config.faversion}
                 }, function (data, ret) {
                     Config['addons'][name].version = version;
                     Layer.closeAll();
@@ -560,7 +560,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
                     return row.addon && row.addon.version != row.version ? '<a href="' + row.url + '?version=' + row.version + '" target="_blank"><span class="releasetips text-primary" data-toggle="tooltip" title="' + __('New version tips', row.version) + '">' + row.addon.version + '<i></i></span></a>' : row.version;
                 },
                 home: function (value, row, index) {
-                    return row.addon ? '<a href="' + row.addon.url + '" data-toggle="tooltip" title="' + __('View addon index page') + '" target="_blank"><i class="fa fa-home text-primary"></i></a>' : '<a href="javascript:;"><i class="fa fa-home text-gray"></i></a>';
+                    return row.addon && parseInt(row.addon.state) > 0 ? '<a href="' + row.addon.url + '" data-toggle="tooltip" title="' + __('View addon index page') + '" target="_blank"><i class="fa fa-home text-primary"></i></a>' : '<a href="javascript:;"><i class="fa fa-home text-gray"></i></a>';
                 },
             },
             bindevent: function () {

+ 2 - 2
public/assets/js/backend/auth/adminlog.js

@@ -24,7 +24,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'id', title: 'ID', operate: false},
                         {field: 'username', title: __('Username'), formatter: Table.api.formatter.search},
                         {field: 'title', title: __('Title'), operate: 'LIKE %...%', placeholder: '模糊搜索'},
-                        {field: 'url', title: __('Url'), align: 'left', formatter: Table.api.formatter.url},
+                        {field: 'url', title: __('Url'), formatter: Table.api.formatter.url},
                         {field: 'ip', title: __('IP'), events: Table.api.events.ip, formatter: Table.api.formatter.search},
                         {field: 'browser', title: __('Browser'), operate: false, formatter: Controller.api.formatter.browser},
                         {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
@@ -58,4 +58,4 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
         }
     };
     return Controller;
-});
+});

+ 1 - 1
public/assets/js/backend/category.js

@@ -28,7 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
-                        {field: 'type', title: __('Type'), operate: false, searchList: Config.searchList, formatter: Table.api.formatter.normal},
+                        {field: 'type', title: __('Type'), operate: false, searchList: Config.searchList, formatter: Table.api.formatter.label},
                         {field: 'name', title: __('Name'), align: 'left'},
                         {field: 'nickname', title: __('Nickname')},
                         {field: 'flag', title: __('Flag'), formatter: Table.api.formatter.flag},

+ 27 - 8
public/assets/js/backend/general/attachment.js

@@ -22,7 +22,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
                 sortName: 'id',
                 columns: [
                     [
-                        {field: 'state', checkbox: true,},
+                        {field: 'state', checkbox: true},
                         {field: 'id', title: __('Id')},
                         {field: 'admin_id', title: __('Admin_id'), visible: false, addClass: "selectpage", extend: "data-source='auth/admin/index' data-field='nickname'"},
                         {field: 'user_id', title: __('User_id'), visible: false, addClass: "selectpage", extend: "data-source='user/user/index' data-field='nickname'"},
@@ -70,9 +70,28 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
                     index_url: 'general/attachment/select',
                 }
             });
+            var urlArr = [];
 
             var table = $("#table");
 
+            table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table', function (e, row) {
+                if (e.type == 'check' || e.type == 'uncheck') {
+                    row = [row];
+                } else {
+                    urlArr = [];
+                }
+                $.each(row, function (i, j) {
+                    if (e.type.indexOf("uncheck") > -1) {
+                        var index = urlArr.indexOf(j.url);
+                        if (index > -1) {
+                            urlArr.splice(index, 1);
+                        }
+                    } else {
+                        urlArr.indexOf(j.url) == -1 && urlArr.push(j.url);
+                    }
+                });
+            });
+
             // 初始化表格
             table.bootstrapTable({
                 url: $.fn.bootstrapTable.defaults.extend.index_url,
@@ -81,10 +100,10 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
                 showExport: false,
                 columns: [
                     [
-                        {field: 'state', checkbox: true,},
+                        {field: 'state', checkbox: true},
                         {field: 'id', title: __('Id')},
-                        {field: 'admin_id', title: __('Admin_id'), visible: false},
-                        {field: 'user_id', title: __('User_id'), visible: false},
+                        {field: 'admin_id', title: __('Admin_id'), formatter: Table.api.formatter.search, visible: false},
+                        {field: 'user_id', title: __('User_id'), formatter: Table.api.formatter.search, visible: false},
                         {field: 'url', title: __('Preview'), formatter: Controller.api.formatter.thumb, operate: false},
                         {field: 'imagewidth', title: __('Imagewidth'), operate: false},
                         {field: 'imageheight', title: __('Imageheight'), operate: false},
@@ -112,10 +131,10 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
 
             // 选中多个
             $(document).on("click", ".btn-choose-multi", function () {
-                var urlArr = new Array();
-                $.each(table.bootstrapTable("getAllSelections"), function (i, j) {
-                    urlArr.push(j.url);
-                });
+                // var urlArr = [];
+                // $.each(table.bootstrapTable("getAllSelections"), function (i, j) {
+                //     urlArr.push(j.url);
+                // });
                 var multiple = Backend.api.query('multiple');
                 multiple = multiple == 'true' ? true : false;
                 Fast.api.close({url: urlArr.join(","), multiple: multiple});

+ 2 - 85
public/assets/js/backend/index.js

@@ -52,89 +52,6 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
                 Backend.api.addtabs($(this).data("url"));
             });
 
-            //读取首次登录推荐插件列表
-            if (localStorage.getItem("fastep") == "installed") {
-                $.ajax({
-                    url: Config.fastadmin.api_url + '/addon/recommend',
-                    type: 'post',
-                    dataType: 'jsonp',
-                    success: function (ret) {
-                        require(['template'], function (Template) {
-                            var install = function (name, title) {
-                                Fast.api.ajax({
-                                    url: 'addon/install',
-                                    data: {name: name, faversion: Config.fastadmin.version}
-                                }, function (data, ret) {
-                                    Fast.api.refreshmenu();
-                                });
-                            };
-                            $(document).on('click', '.btn-install', function () {
-                                $(this).prop("disabled", true).addClass("disabled");
-                                $("input[name=addon]:checked").each(function () {
-                                    install($(this).data("name"));
-                                });
-                                return false;
-                            });
-                            $(document).on('click', '.btn-notnow', function () {
-                                Layer.closeAll();
-                            });
-                            Layer.open({
-                                type: 1, skin: 'layui-layer-page', area: ["860px", "620px"], title: '',
-                                content: Template.render(ret.tpl, {addonlist: ret.rows})
-                            });
-                            localStorage.setItem("fastep", "dashboard");
-                        });
-                    }
-                });
-            }
-
-            //版本检测
-            var checkupdate = function (ignoreversion, tips) {
-                $.ajax({
-                    url: Config.fastadmin.api_url + '/version/check',
-                    type: 'post',
-                    data: {version: Config.fastadmin.version},
-                    dataType: 'jsonp',
-                    success: function (ret) {
-                        if (ret.data && ignoreversion !== ret.data.newversion) {
-                            Layer.open({
-                                title: __('Discover new version'),
-                                maxHeight: 400,
-                                content: '<h5 style="background-color:#f7f7f7; font-size:14px; padding: 10px;">' + __('Your current version') + ':' + ret.data.version + ',' + __('New version') + ':' + ret.data.newversion + '</h5><span class="label label-danger">' + __('Release notes') + '</span><br/>' + ret.data.upgradetext,
-                                btn: [__('Go to download'), __('Ignore this version'), __('Do not remind again')],
-                                btn2: function (index, layero) {
-                                    localStorage.setItem("ignoreversion", ret.data.newversion);
-                                },
-                                btn3: function (index, layero) {
-                                    localStorage.setItem("ignoreversion", "*");
-                                },
-                                success: function (layero, index) {
-                                    $(".layui-layer-btn0", layero).attr("href", ret.data.downloadurl).attr("target", "_blank");
-                                }
-                            });
-                        } else {
-                            if (tips) {
-                                Toastr.success(__('Currently is the latest version'));
-                            }
-                        }
-                    }, error: function (e) {
-                        if (tips) {
-                            Toastr.error(__('Unknown data format') + ":" + e.message);
-                        }
-                    }
-                });
-            };
-
-            //读取版本检测信息
-            var ignoreversion = localStorage.getItem("ignoreversion");
-            if (Config.fastadmin.checkupdate && ignoreversion !== "*") {
-                checkupdate(ignoreversion, false);
-            }
-            //手动检测版本信息
-            $("a[data-toggle='checkupdate']").on('click', function () {
-                checkupdate('', true);
-            });
-
             //切换左侧sidebar显示隐藏
             $(document).on("click fa.event.toggleitem", ".sidebar-menu li > a", function (e) {
                 $(".sidebar-menu li").removeClass("active");
@@ -188,7 +105,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
                 }
             });
 
-            var multiplenav = Config.fastadmin.multiplenav;
+            var multiplenav = $("#secondnav").size() > 0 ? true : false;
             var firstnav = $("#firstnav .nav-addtabs");
             var nav = multiplenav ? $("#secondnav .nav-addtabs") : firstnav;
 
@@ -287,7 +204,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
             if ($("ul.sidebar-menu li.active a").size() > 0) {
                 $("ul.sidebar-menu li.active a").trigger("click");
             } else {
-                if (Config.fastadmin.multiplenav) {
+                if (multiplenav) {
                     $("li:first > a", firstnav).trigger("click");
                 } else {
                     $("ul.sidebar-menu li a[url!='javascript:;']:first").trigger("click");

+ 3 - 0
public/assets/js/require-backend.js

@@ -104,6 +104,9 @@ require.config({
             deps: ['bootstrap', 'slimscroll'],
             exports: '$.AdminLTE'
         },
+        'bootstrap-daterangepicker': [
+            'moment/locale/zh-cn'
+        ],
         'bootstrap-datetimepicker': [
             'moment/locale/zh-cn',
 //            'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',

File diff suppressed because it is too large
+ 10 - 4
public/assets/js/require-backend.min.js


+ 3 - 0
public/assets/js/require-frontend.js

@@ -103,6 +103,9 @@ require.config({
             deps: ['bootstrap', 'slimscroll'],
             exports: '$.AdminLTE'
         },
+        'bootstrap-daterangepicker': [
+            'moment/locale/zh-cn'
+        ],
         'bootstrap-datetimepicker': [
             'moment/locale/zh-cn',
 //            'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',

File diff suppressed because it is too large
+ 5 - 2
public/assets/js/require-frontend.min.js


+ 3 - 1
public/assets/js/require-table.js

@@ -523,6 +523,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                     return html;
                 },
                 toggle: function (value, row, index) {
+                    var table = this.table;
+                    var options = table ? table.bootstrapTable('getOptions') : {};
                     var color = typeof this.color !== 'undefined' ? this.color : 'success';
                     var yes = typeof this.yes !== 'undefined' ? this.yes : 1;
                     var no = typeof this.no !== 'undefined' ? this.no : 0;
@@ -532,7 +534,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                         disable = typeof this.disable === "function" ? this.disable.call(this, value, row, index) : this.disable;
                     }
                     return "<a href='javascript:;' data-toggle='tooltip' title='" + __('Click to toggle') + "' class='btn-change " + (disable ? 'btn disabled' : '') + "' data-id='"
-                        + row.id + "' " + (url ? "data-url='" + url + "'" : "") + " data-params='" + this.field + "=" + (value == yes ? no : yes) + "'><i class='fa fa-toggle-on " + (value == yes ? 'text-' + color : 'fa-flip-horizontal text-gray') + " fa-2x'></i></a>";
+                        + row[options.pk] + "' " + (url ? "data-url='" + url + "'" : "") + " data-params='" + this.field + "=" + (value == yes ? no : yes) + "'><i class='fa fa-toggle-on " + (value == yes ? 'text-' + color : 'fa-flip-horizontal text-gray') + " fa-2x'></i></a>";
                 },
                 url: function (value, row, index) {
                     return '<div class="input-group input-group-sm" style="width:250px;margin:0 auto;"><input type="text" class="form-control input-sm" value="' + value + '"><span class="input-group-btn input-group-sm"><a href="' + value + '" target="_blank" class="btn btn-default btn-sm"><i class="fa fa-link"></i></a></span></div>';

+ 2 - 2
public/assets/js/require-upload.js

@@ -4,7 +4,7 @@ define(['jquery', 'bootstrap', 'plupload', 'template'], function ($, undefined,
             config: {
                 container: document.body,
                 classname: '.plupload:not([initialized])',
-                previewtpl: '<li class="col-xs-3"><a href="<%=fullurl%>" data-url="<%=url%>" target="_blank" class="thumbnail"><img src="<%=fullurl%>" onerror="this.src=\'https://tool.fastadmin.net/icon/\'+\'<%=fullurl%>\'.split(\'.\').pop()+\'.png\';this.onerror=null;" class="img-responsive"></a><a href="javascript:;" class="btn btn-danger btn-xs btn-trash"><i class="fa fa-trash"></i></a></li>',
+                previewtpl: '<li class="col-xs-3"><a href="<%=fullurl%>" data-url="<%=url%>" target="_blank" class="thumbnail"><img src="<%=fullurl%>" onerror="this.src=\'' + Fast.api.fixurl("ajax/icon") + '?suffix=\'+\'<%=fullurl%>\'.split(\'.\').pop();this.onerror=null;" class="img-responsive"></a><a href="javascript:;" class="btn btn-danger btn-xs btn-trash"><i class="fa fa-trash"></i></a></li>',
             },
             events: {
                 onInit: function (up) {
@@ -435,4 +435,4 @@ define(['jquery', 'bootstrap', 'plupload', 'template'], function ($, undefined,
     ;
 
     return Upload;
-});
+});

+ 1 - 1
public/index.php

@@ -13,7 +13,7 @@
 // 定义应用目录
 define('APP_PATH', __DIR__ . '/../application/');
 
-// 判断是否安装FastAdmin
+// 判断是否安装
 if (!is_file(APP_PATH . 'admin/command/Install/install.lock'))
 {
     header("location:./install.php");

File diff suppressed because it is too large
+ 22 - 500
public/install.php