作者 Karson

新增附件管理标签过滤

新增语言包缓存
新增生成文件后缀图片
新增Layer弹窗自动获得焦点
新增附件图片按序选择填充
新增插件管理一键切换无远程插件模式
优化表格列表开关组件
优化安装脚本
优化CRUD菜单删除
优化前台模板
优化插件列表接口检测
优化系统配置
正在显示 71 个修改的文件 包含 924 行增加1323 行删除
1 FastAdmin是一款基于ThinkPHP5+Bootstrap的极速后台开发框架。 1 FastAdmin是一款基于ThinkPHP5+Bootstrap的极速后台开发框架。
2 2
3 3
4 -## **主要特性** 4 +## 主要特性
5 5
6 * 基于`Auth`验证的权限管理系统 6 * 基于`Auth`验证的权限管理系统
7 * 支持无限级父子级权限继承,父级的管理员可任意增删改子级管理员及权限设置 7 * 支持无限级父子级权限继承,父级的管理员可任意增删改子级管理员及权限设置
@@ -24,6 +24,8 @@ FastAdmin是一款基于ThinkPHP5+Bootstrap的极速后台开发框架。 @@ -24,6 +24,8 @@ FastAdmin是一款基于ThinkPHP5+Bootstrap的极速后台开发框架。
24 * 二级域名部署支持,同时域名支持绑定到插件 24 * 二级域名部署支持,同时域名支持绑定到插件
25 * 多语言支持,服务端及客户端支持 25 * 多语言支持,服务端及客户端支持
26 * 强大的第三方模块支持([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)) 26 * 强大的第三方模块支持([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))
  27 +* 支持CMS、博客、知识付费问答无缝整合[Xunsearch全文搜索](https://www.fastadmin.net/store/xunsearch.html)
  28 +* 第三方小程序支持([预订小程序](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))
27 * 整合第三方短信接口(阿里云、腾讯云短信) 29 * 整合第三方短信接口(阿里云、腾讯云短信)
28 * 无缝整合第三方云存储(七牛、阿里云OSS、又拍云)功能 30 * 无缝整合第三方云存储(七牛、阿里云OSS、又拍云)功能
29 * 第三方富文本编辑器支持(Summernote、Kindeditor、百度编辑器) 31 * 第三方富文本编辑器支持(Summernote、Kindeditor、百度编辑器)
@@ -31,11 +33,11 @@ FastAdmin是一款基于ThinkPHP5+Bootstrap的极速后台开发框架。 @@ -31,11 +33,11 @@ FastAdmin是一款基于ThinkPHP5+Bootstrap的极速后台开发框架。
31 * 第三方支付(微信、支付宝)无缝整合,微信支持PC端扫码支付 33 * 第三方支付(微信、支付宝)无缝整合,微信支持PC端扫码支付
32 * 丰富的插件应用市场 34 * 丰富的插件应用市场
33 35
34 -## **安装使用** 36 +## 安装使用
35 37
36 https://doc.fastadmin.net 38 https://doc.fastadmin.net
37 39
38 -## **在线演示** 40 +## 在线演示
39 41
40 https://demo.fastadmin.net 42 https://demo.fastadmin.net
41 43
@@ -45,24 +47,22 @@ https://demo.fastadmin.net @@ -45,24 +47,22 @@ https://demo.fastadmin.net
45 47
46 提 示:演示站数据无法进行修改,请下载源码安装体验全部功能 48 提 示:演示站数据无法进行修改,请下载源码安装体验全部功能
47 49
48 -## **界面截图** 50 +## 界面截图
49 ![控制台](https://gitee.com/uploads/images/2017/0411/113717_e99ff3e7_10933.png "控制台") 51 ![控制台](https://gitee.com/uploads/images/2017/0411/113717_e99ff3e7_10933.png "控制台")
50 52
51 -## **问题反馈** 53 +## 问题反馈
52 54
53 在使用中有任何问题,请使用以下联系方式联系我们 55 在使用中有任何问题,请使用以下联系方式联系我们
54 56
55 交流社区: https://ask.fastadmin.net 57 交流社区: https://ask.fastadmin.net
56 58
57 -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群)  
58 -  
59 -Email: (karson#fastadmin.net, 把#换成@) 59 +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群)
60 60
61 Github: https://github.com/karsonzhang/fastadmin 61 Github: https://github.com/karsonzhang/fastadmin
62 62
63 Gitee: https://gitee.com/karson/fastadmin 63 Gitee: https://gitee.com/karson/fastadmin
64 64
65 -## **特别鸣谢** 65 +## 特别鸣谢
66 66
67 感谢以下的项目,排名不分先后 67 感谢以下的项目,排名不分先后
68 68
@@ -81,7 +81,7 @@ Nice-validator: https://validator.niceue.com @@ -81,7 +81,7 @@ Nice-validator: https://validator.niceue.com
81 SelectPage: https://github.com/TerryZ/SelectPage 81 SelectPage: https://github.com/TerryZ/SelectPage
82 82
83 83
84 -## **版权信息** 84 +## 版权信息
85 85
86 FastAdmin遵循Apache2开源协议发布,并提供免费使用。 86 FastAdmin遵循Apache2开源协议发布,并提供免费使用。
87 87
@@ -89,4 +89,4 @@ FastAdmin遵循Apache2开源协议发布,并提供免费使用。 @@ -89,4 +89,4 @@ FastAdmin遵循Apache2开源协议发布,并提供免费使用。
89 89
90 版权所有Copyright © 2017-2020 by FastAdmin (https://www.fastadmin.net) 90 版权所有Copyright © 2017-2020 by FastAdmin (https://www.fastadmin.net)
91 91
92 -All rights reserved。  
  92 +All rights reserved。
@@ -34,8 +34,8 @@ class Addon extends Command @@ -34,8 +34,8 @@ class Addon extends Command
34 { 34 {
35 $name = $input->getOption('name') ?: ''; 35 $name = $input->getOption('name') ?: '';
36 $action = $input->getOption('action') ?: ''; 36 $action = $input->getOption('action') ?: '';
37 - if (stripos($name, 'addons/') !== false) {  
38 - $name = explode('/', $name)[1]; 37 + if (stripos($name, 'addons' . DS) !== false) {
  38 + $name = explode(DS, $name)[1];
39 } 39 }
40 //强制覆盖 40 //强制覆盖
41 $force = $input->getOption('force'); 41 $force = $input->getOption('force');
@@ -96,6 +96,7 @@ class Api extends Command @@ -96,6 +96,7 @@ class Api extends Command
96 $classes = array_unique(array_filter($classes)); 96 $classes = array_unique(array_filter($classes));
97 97
98 $config = [ 98 $config = [
  99 + 'sitename' => config('site.name'),
99 'title' => $title, 100 'title' => $title,
100 'author' => $author, 101 'author' => $author,
101 'description' => '', 102 'description' => '',
@@ -115,8 +116,8 @@ class Api extends Command @@ -115,8 +116,8 @@ class Api extends Command
115 * get full qualified class name 116 * get full qualified class name
116 * 117 *
117 * @param string $path_to_file 118 * @param string $path_to_file
118 - * @author JBYRNE http://jarretbyrne.com/2015/06/197/  
119 * @return string 119 * @return string
  120 + * @author JBYRNE http://jarretbyrne.com/2015/06/197/
120 */ 121 */
121 protected function get_class_from_file($path_to_file) 122 protected function get_class_from_file($path_to_file)
122 { 123 {
@@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
5 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6 <meta name="viewport" content="width=device-width, initial-scale=1.0">
7 <meta name="description" content=""> 7 <meta name="description" content="">
8 - <meta name="author" content="{$config.author}">  
9 <title>{$config.title}</title> 8 <title>{$config.title}</title>
10 9
11 <!-- Bootstrap Core CSS --> 10 <!-- Bootstrap Core CSS -->
@@ -109,7 +108,7 @@ @@ -109,7 +108,7 @@
109 <span class="icon-bar"></span> 108 <span class="icon-bar"></span>
110 <span class="icon-bar"></span> 109 <span class="icon-bar"></span>
111 </button> 110 </button>
112 - <a class="navbar-brand" href="https://www.fastadmin.net" target="_blank">{$config.title}</a> 111 + <a class="navbar-brand" href="./" target="_blank">{$config.title}</a>
113 </div> 112 </div>
114 <div class="navbar-collapse collapse"> 113 <div class="navbar-collapse collapse">
115 <form class="navbar-form navbar-right"> 114 <form class="navbar-form navbar-right">
@@ -350,7 +349,7 @@ @@ -350,7 +349,7 @@
350 Generated on {:date('Y-m-d H:i:s')} 349 Generated on {:date('Y-m-d H:i:s')}
351 </div> 350 </div>
352 <div class="col-md-6" align="right"> 351 <div class="col-md-6" align="right">
353 - <a href="https://www.fastadmin.net" target="_blank">FastAdmin</a> 352 + <a href="./" target="_blank">{$config.sitename}</a>
354 </div> 353 </div>
355 </div> 354 </div>
356 355
@@ -440,6 +440,11 @@ class Crud extends Command @@ -440,6 +440,11 @@ class Crud extends Command
440 } 440 }
441 } 441 }
442 442
  443 + //继续删除菜单
  444 + if ($menu) {
  445 + exec("php think menu -c {$controllerUrl} -d 1 -f 1");
  446 + }
  447 +
443 $output->info("Delete Successed"); 448 $output->info("Delete Successed");
444 return; 449 return;
445 } 450 }
@@ -1455,6 +1460,9 @@ EOD; @@ -1455,6 +1460,9 @@ EOD;
1455 if (in_array($formatter, ['image', 'images'])) { 1460 if (in_array($formatter, ['image', 'images'])) {
1456 $html .= ", events: Table.api.events.image"; 1461 $html .= ", events: Table.api.events.image";
1457 } 1462 }
  1463 + if (in_array($formatter, ['toggle'])) {
  1464 + $html .= ", table: table";
  1465 + }
1458 if ($itemArr && !$formatter) { 1466 if ($itemArr && !$formatter) {
1459 $formatter = 'normal'; 1467 $formatter = 'normal';
1460 } 1468 }
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 namespace app\admin\command; 3 namespace app\admin\command;
4 4
  5 +use fast\Random;
5 use PDO; 6 use PDO;
6 use think\Config; 7 use think\Config;
7 use think\console\Command; 8 use think\console\Command;
@@ -10,10 +11,22 @@ use think\console\input\Option; @@ -10,10 +11,22 @@ use think\console\input\Option;
10 use think\console\Output; 11 use think\console\Output;
11 use think\Db; 12 use think\Db;
12 use think\Exception; 13 use think\Exception;
  14 +use think\Lang;
  15 +use think\Request;
  16 +use think\View;
13 17
14 class Install extends Command 18 class Install extends Command
15 { 19 {
16 protected $model = null; 20 protected $model = null;
  21 + /**
  22 + * @var \think\View 视图类实例
  23 + */
  24 + protected $view;
  25 +
  26 + /**
  27 + * @var \think\Request Request 实例
  28 + */
  29 + protected $request;
17 30
18 protected function configure() 31 protected function configure()
19 { 32 {
@@ -30,8 +43,12 @@ class Install extends Command @@ -30,8 +43,12 @@ class Install extends Command
30 ->setDescription('New installation of FastAdmin'); 43 ->setDescription('New installation of FastAdmin');
31 } 44 }
32 45
  46 + /**
  47 + * 命令行安装
  48 + */
33 protected function execute(Input $input, Output $output) 49 protected function execute(Input $input, Output $output)
34 { 50 {
  51 + define('INSTALL_PATH', APP_PATH . 'admin' . DS . 'command' . DS . 'Install' . DS);
35 // 覆盖安装 52 // 覆盖安装
36 $force = $input->getOption('force'); 53 $force = $input->getOption('force');
37 $hostname = $input->getOption('hostname'); 54 $hostname = $input->getOption('hostname');
@@ -41,68 +58,236 @@ class Install extends Command @@ -41,68 +58,236 @@ class Install extends Command
41 $username = $input->getOption('username'); 58 $username = $input->getOption('username');
42 $password = $input->getOption('password'); 59 $password = $input->getOption('password');
43 60
44 - $installLockFile = __DIR__ . "/Install/install.lock"; 61 + $installLockFile = INSTALL_PATH . "install.lock";
45 if (is_file($installLockFile) && !$force) { 62 if (is_file($installLockFile) && !$force) {
46 throw new Exception("\nFastAdmin already installed!\nIf you need to reinstall again, use the parameter --force=true "); 63 throw new Exception("\nFastAdmin already installed!\nIf you need to reinstall again, use the parameter --force=true ");
47 } 64 }
48 65
49 - $sql = file_get_contents(__DIR__ . '/Install/fastadmin.sql'); 66 + $adminUsername = 'admin';
  67 + $adminPassword = Random::alnum(10);
  68 + $adminEmail = 'admin@admin.com';
  69 + $siteName = __('My Website');
50 70
51 - $sql = str_replace("`fa_", "`{$prefix}", $sql); 71 + $adminName = $this->installation($hostname, $hostport, $database, $username, $password, $prefix, $adminUsername, $adminPassword, $adminEmail, $siteName);
  72 + if ($adminName) {
  73 + $output->highlight("Admin url:http://www.yoursite.com/{$adminName}");
  74 + }
52 75
53 - // 先尝试能否自动创建数据库  
54 - $config = Config::get('database');  
55 - $pdo = new PDO("{$config['type']}:host={$hostname}" . ($hostport ? ";port={$hostport}" : ''), $username, $password);  
56 - $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);  
57 - $pdo->query("CREATE DATABASE IF NOT EXISTS `{$database}` CHARACTER SET utf8 COLLATE utf8_general_ci;"); 76 + $output->highlight("Admin username:{$adminUsername}");
  77 + $output->highlight("Admin password:{$adminPassword}");
58 78
59 - // 连接install命令中指定的数据库  
60 - $instance = Db::connect([  
61 - 'type' => "{$config['type']}",  
62 - 'hostname' => "{$hostname}",  
63 - 'hostport' => "{$hostport}",  
64 - 'database' => "{$database}",  
65 - 'username' => "{$username}",  
66 - 'password' => "{$password}",  
67 - ]); 79 + \think\Cache::rm('__menu__');
68 80
69 - // 查询一次SQL,判断连接是否正常  
70 - $instance->execute("SELECT 1"); 81 + $output->info("Install Successed!");
  82 + }
71 83
72 - // 调用原生PDO对象进行批量查询  
73 - $instance->getPdo()->exec($sql); 84 + /**
  85 + * PC端安装
  86 + */
  87 + public function index()
  88 + {
  89 + $this->view = View::instance(Config::get('template'), Config::get('view_replace_str'));
  90 + $this->request = Request::instance();
  91 +
  92 + define('INSTALL_PATH', APP_PATH . 'admin' . DS . 'command' . DS . 'Install' . DS);
  93 + Lang::load(INSTALL_PATH . $this->request->langset() . '.php');
74 94
75 - file_put_contents($installLockFile, 1); 95 + $installLockFile = INSTALL_PATH . "install.lock";
  96 +
  97 + if (is_file($installLockFile)) {
  98 + echo __('The system has been installed. If you need to reinstall, please remove %s first', 'install.lock');
  99 + exit;
  100 + }
  101 + $output = function ($code, $msg, $url = null, $data = null) {
  102 + return json(['code' => $code, 'msg' => $msg, 'url' => $url, 'data' => $data]);
  103 + };
  104 +
  105 + if ($this->request->isPost()) {
  106 + $mysqlHostname = $this->request->post('mysqlHostname', '127.0.0.1');
  107 + $mysqlHostport = $this->request->post('mysqlHostport', '3306');
  108 + $hostArr = explode(':', $mysqlHostname);
  109 + if (count($hostArr) > 1) {
  110 + $mysqlHostname = $hostArr[0];
  111 + $mysqlHostport = $hostArr[1];
  112 + }
  113 + $mysqlUsername = $this->request->post('mysqlUsername', 'root');
  114 + $mysqlPassword = $this->request->post('mysqlPassword', '');
  115 + $mysqlDatabase = $this->request->post('mysqlDatabase', '');
  116 + $mysqlPrefix = $this->request->post('mysqlPrefix', 'fa_');
  117 + $adminUsername = $this->request->post('adminUsername', 'admin');
  118 + $adminPassword = $this->request->post('adminPassword', '');
  119 + $adminPasswordConfirmation = $this->request->post('adminPasswordConfirmation', '');
  120 + $adminEmail = $this->request->post('adminEmail', 'admin@admin.com');
  121 + $siteName = $this->request->post('siteName', __('My Website'));
  122 +
  123 + if ($adminPassword !== $adminPasswordConfirmation) {
  124 + return $output(0, __('The two passwords you entered did not match'));
  125 + }
  126 +
  127 + $adminName = '';
  128 + try {
  129 + $adminName = $this->installation($mysqlHostname, $mysqlHostport, $mysqlDatabase, $mysqlUsername, $mysqlPassword, $mysqlPrefix, $adminUsername, $adminPassword, $adminEmail, $siteName);
  130 + } catch (\PDOException $e) {
  131 + throw new Exception($e->getMessage());
  132 + } catch (\Exception $e) {
  133 + return $output(0, $e->getMessage());
  134 + }
  135 + return $output(1, __('Install Successed'), null, ['adminName' => $adminName]);
  136 + }
  137 + $errInfo = '';
  138 + try {
  139 + $this->checkenv();
  140 + } catch (\Exception $e) {
  141 + $errInfo = $e->getMessage();
  142 + }
  143 + return $this->view->fetch(INSTALL_PATH . "install.html", ['errInfo' => $errInfo]);
  144 + }
  145 +
  146 + /**
  147 + * 执行安装
  148 + */
  149 + protected function installation($mysqlHostname, $mysqlHostport, $mysqlDatabase, $mysqlUsername, $mysqlPassword, $mysqlPrefix, $adminUsername, $adminPassword, $adminEmail = null, $siteName = null)
  150 + {
  151 + $this->checkenv();
  152 +
  153 + if ($mysqlDatabase == '') {
  154 + throw new Exception(__('Please input correct database'));
  155 + }
  156 + if (!preg_match("/^\w{3,12}$/", $adminUsername)) {
  157 + throw new Exception(__('Please input correct username'));
  158 + }
  159 + if (!preg_match("/^[\S]{6,16}$/", $adminPassword)) {
  160 + throw new Exception(__('Please input correct password'));
  161 + }
  162 + if ($siteName == '' || preg_match("/fast" . "admin/i", $siteName)) {
  163 + throw new Exception(__('Please input correct website'));
  164 + }
76 165
77 - //后台入口文件 166 + $sql = file_get_contents(INSTALL_PATH . 'fastadmin.sql');
  167 +
  168 + $sql = str_replace("`fa_", "`{$mysqlPrefix}", $sql);
  169 +
  170 + // 先尝试能否自动创建数据库
  171 + $config = Config::get('database');
  172 + try {
  173 + $pdo = new PDO("{$config['type']}:host={$mysqlHostname}" . ($mysqlHostport ? ";port={$mysqlHostport}" : ''), $mysqlUsername, $mysqlPassword);
  174 + $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  175 + $pdo->query("CREATE DATABASE IF NOT EXISTS `{$mysqlDatabase}` CHARACTER SET utf8 COLLATE utf8_general_ci;");
  176 +
  177 + // 连接install命令中指定的数据库
  178 + $instance = Db::connect([
  179 + 'type' => "{$config['type']}",
  180 + 'hostname' => "{$mysqlHostname}",
  181 + 'hostport' => "{$mysqlHostport}",
  182 + 'database' => "{$mysqlDatabase}",
  183 + 'username' => "{$mysqlUsername}",
  184 + 'password' => "{$mysqlPassword}",
  185 + 'prefix' => "{$mysqlPrefix}",
  186 + ]);
  187 +
  188 + // 查询一次SQL,判断连接是否正常
  189 + $instance->execute("SELECT 1");
  190 +
  191 + // 调用原生PDO对象进行批量查询
  192 + $instance->getPdo()->exec($sql);
  193 + } catch (\PDOException $e) {
  194 + throw new Exception($e->getMessage());
  195 + }
  196 + // 后台入口文件
78 $adminFile = ROOT_PATH . 'public' . DS . 'admin.php'; 197 $adminFile = ROOT_PATH . 'public' . DS . 'admin.php';
79 198
  199 + // 数据库配置文件
80 $dbConfigFile = APP_PATH . 'database.php'; 200 $dbConfigFile = APP_PATH . 'database.php';
81 $config = @file_get_contents($dbConfigFile); 201 $config = @file_get_contents($dbConfigFile);
82 - $callback = function ($matches) use ($hostname, $hostport, $username, $password, $database, $prefix) {  
83 - $field = $matches[1]; 202 + $callback = function ($matches) use ($mysqlHostname, $mysqlHostport, $mysqlUsername, $mysqlPassword, $mysqlDatabase, $mysqlPrefix) {
  203 + $field = "mysql" . ucfirst($matches[1]);
84 $replace = $$field; 204 $replace = $$field;
85 - if ($matches[1] == 'hostport' && $hostport == 3306) { 205 + if ($matches[1] == 'hostport' && $mysqlHostport == 3306) {
86 $replace = ''; 206 $replace = '';
87 } 207 }
88 return "'{$matches[1]}'{$matches[2]}=>{$matches[3]}Env::get('database.{$matches[1]}', '{$replace}'),"; 208 return "'{$matches[1]}'{$matches[2]}=>{$matches[3]}Env::get('database.{$matches[1]}', '{$replace}'),";
89 }; 209 };
90 $config = preg_replace_callback("/'(hostname|database|username|password|hostport|prefix)'(\s+)=>(\s+)Env::get\((.*)\)\,/", $callback, $config); 210 $config = preg_replace_callback("/'(hostname|database|username|password|hostport|prefix)'(\s+)=>(\s+)Env::get\((.*)\)\,/", $callback, $config);
91 - // 写入数据库配置  
92 - file_put_contents($dbConfigFile, $config);  
93 211
  212 + // 检测能否成功写入数据库配置
  213 + $result = @file_put_contents($dbConfigFile, $config);
  214 + if (!$result) {
  215 + throw new Exception(__('The current permissions are insufficient to write the file %s', 'application/database.php'));
  216 + }
  217 +
  218 + // 变更默认管理员密码
  219 + $adminPassword = $adminPassword ? $adminPassword : Random::alnum(8);
  220 + $adminEmail = $adminEmail ? $adminEmail : "admin@admin.com";
  221 + $newSalt = substr(md5(uniqid(true)), 0, 6);
  222 + $newPassword = md5(md5($adminPassword) . $newSalt);
  223 + $data = ['username' => $adminUsername, 'email' => $adminEmail, 'password' => $newPassword, 'salt' => $newSalt];
  224 + $instance->name('admin')->where('username', 'admin')->update($data);
94 // 修改后台入口 225 // 修改后台入口
  226 + $adminName = '';
95 if (is_file($adminFile)) { 227 if (is_file($adminFile)) {
96 - $x = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';  
97 - $adminName = substr(str_shuffle(str_repeat($x, ceil(10 / strlen($x)))), 1, 10) . '.php'; 228 + $adminName = Random::alpha(10) . '.php';
98 rename($adminFile, ROOT_PATH . 'public' . DS . $adminName); 229 rename($adminFile, ROOT_PATH . 'public' . DS . $adminName);
99 - $output->highlight("Admin url:http://www.yoursite.com/{$adminName}");  
100 } 230 }
101 - $output->highlight("Admin username:admin");  
102 - $output->highlight("Admin password:123456");  
103 231
104 - \think\Cache::rm('__menu__'); 232 + //修改站点名称
  233 + if ($siteName != __('My Website')) {
  234 + $instance->name('config')->where('name', 'name')->update(['value' => $siteName]);
  235 + $configFile = APP_PATH . 'extra' . DS . 'site.php';
  236 + $config = include $configFile;
  237 + $configList = $instance->name("config")->select();
  238 + foreach ($configList as $k => $value) {
  239 + if (in_array($value['type'], ['selects', 'checkbox', 'images', 'files'])) {
  240 + $value['value'] = explode(',', $value['value']);
  241 + }
  242 + if ($value['type'] == 'array') {
  243 + $value['value'] = (array)json_decode($value['value'], true);
  244 + }
  245 + $config[$value['name']] = $value['value'];
  246 + }
  247 + $config['name'] = $siteName;
  248 + file_put_contents($configFile, '<?php' . "\n\nreturn " . var_export($config, true) . ";");
  249 + }
105 250
106 - $output->info("Install Successed!"); 251 + $installLockFile = INSTALL_PATH . "install.lock";
  252 + //检测能否成功写入lock文件
  253 + $result = @file_put_contents($installLockFile, 1);
  254 + if (!$result) {
  255 + throw new Exception(__('The current permissions are insufficient to write the file %s', 'application/admin/command/Install/install.lock'));
  256 + }
  257 +
  258 + return $adminName;
  259 + }
  260 +
  261 + /**
  262 + * 检测环境
  263 + */
  264 + protected function checkenv()
  265 + {
  266 + // 检测目录是否存在
  267 + $checkDirs = [
  268 + 'thinkphp',
  269 + 'vendor',
  270 + 'public' . DS . 'assets' . DS . 'libs'
  271 + ];
  272 +
  273 + //数据库配置文件
  274 + $dbConfigFile = APP_PATH . 'database.php';
  275 +
  276 + if (version_compare(PHP_VERSION, '5.5.0', '<')) {
  277 + throw new Exception(__("The current version %s is too low, please use PHP 5.5 or higher", PHP_VERSION));
  278 + }
  279 + if (!extension_loaded("PDO")) {
  280 + throw new Exception(__("PDO is not currently installed and cannot be installed"));
  281 + }
  282 + if (!is_really_writable($dbConfigFile)) {
  283 + throw new Exception(__('The current permissions are insufficient to write the configuration file application/database.php'));
  284 + }
  285 + foreach ($checkDirs as $k => $v) {
  286 + if (!is_dir(ROOT_PATH . $v)) {
  287 + throw new Exception(__('Please go to the official website to download the full package or resource package and try to install'));
  288 + break;
  289 + }
  290 + }
  291 + return true;
107 } 292 }
108 } 293 }
1 /* 1 /*
2 FastAdmin Install SQL 2 FastAdmin Install SQL
3 -  
4 - 官网: https://www.fastadmin.net  
5 - 演示: https://demo.fastadmin.net  
6 -  
7 Date: 2018年05月26日 3 Date: 2018年05月26日
8 */ 4 */
9 5
@@ -30,13 +26,13 @@ CREATE TABLE `fa_admin` ( @@ -30,13 +26,13 @@ CREATE TABLE `fa_admin` (
30 `status` varchar(30) NOT NULL DEFAULT 'normal' COMMENT '状态', 26 `status` varchar(30) NOT NULL DEFAULT 'normal' COMMENT '状态',
31 PRIMARY KEY (`id`), 27 PRIMARY KEY (`id`),
32 UNIQUE KEY `username` (`username`) USING BTREE 28 UNIQUE KEY `username` (`username`) USING BTREE
33 -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='管理员表'; 29 +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员表';
34 30
35 -- ---------------------------- 31 -- ----------------------------
36 -- Records of fa_admin 32 -- Records of fa_admin
37 -- ---------------------------- 33 -- ----------------------------
38 BEGIN; 34 BEGIN;
39 -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'); 35 +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');
40 COMMIT; 36 COMMIT;
41 37
42 -- ---------------------------- 38 -- ----------------------------
@@ -55,7 +51,7 @@ CREATE TABLE `fa_admin_log` ( @@ -55,7 +51,7 @@ CREATE TABLE `fa_admin_log` (
55 `createtime` int(10) DEFAULT NULL COMMENT '操作时间', 51 `createtime` int(10) DEFAULT NULL COMMENT '操作时间',
56 PRIMARY KEY (`id`), 52 PRIMARY KEY (`id`),
57 KEY `name` (`username`) 53 KEY `name` (`username`)
58 -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='管理员日志表'; 54 +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='管理员日志表';
59 55
60 -- ---------------------------- 56 -- ----------------------------
61 -- Table structure for fa_attachment 57 -- Table structure for fa_attachment
@@ -79,7 +75,7 @@ CREATE TABLE `fa_attachment` ( @@ -79,7 +75,7 @@ CREATE TABLE `fa_attachment` (
79 `storage` varchar(100) NOT NULL DEFAULT 'local' COMMENT '存储位置', 75 `storage` varchar(100) NOT NULL DEFAULT 'local' COMMENT '存储位置',
80 `sha1` varchar(40) NOT NULL DEFAULT '' COMMENT '文件 sha1编码', 76 `sha1` varchar(40) NOT NULL DEFAULT '' COMMENT '文件 sha1编码',
81 PRIMARY KEY (`id`) 77 PRIMARY KEY (`id`)
82 -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='附件表'; 78 +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='附件表';
83 79
84 -- ---------------------------- 80 -- ----------------------------
85 -- Records of fa_attachment 81 -- Records of fa_attachment
@@ -101,7 +97,7 @@ CREATE TABLE `fa_auth_group` ( @@ -101,7 +97,7 @@ CREATE TABLE `fa_auth_group` (
101 `updatetime` int(10) DEFAULT NULL COMMENT '更新时间', 97 `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
102 `status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态', 98 `status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态',
103 PRIMARY KEY (`id`) 99 PRIMARY KEY (`id`)
104 -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='分组表'; 100 +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='分组表';
105 101
106 -- ---------------------------- 102 -- ----------------------------
107 -- Records of fa_auth_group 103 -- Records of fa_auth_group
@@ -124,7 +120,7 @@ CREATE TABLE `fa_auth_group_access` ( @@ -124,7 +120,7 @@ CREATE TABLE `fa_auth_group_access` (
124 UNIQUE KEY `uid_group_id` (`uid`,`group_id`), 120 UNIQUE KEY `uid_group_id` (`uid`,`group_id`),
125 KEY `uid` (`uid`), 121 KEY `uid` (`uid`),
126 KEY `group_id` (`group_id`) 122 KEY `group_id` (`group_id`)
127 -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='权限分组表'; 123 +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='权限分组表';
128 124
129 -- ---------------------------- 125 -- ----------------------------
130 -- Records of fa_auth_group_access 126 -- Records of fa_auth_group_access
@@ -155,7 +151,7 @@ CREATE TABLE `fa_auth_rule` ( @@ -155,7 +151,7 @@ CREATE TABLE `fa_auth_rule` (
155 UNIQUE KEY `name` (`name`) USING BTREE, 151 UNIQUE KEY `name` (`name`) USING BTREE,
156 KEY `pid` (`pid`), 152 KEY `pid` (`pid`),
157 KEY `weigh` (`weigh`) 153 KEY `weigh` (`weigh`)
158 -) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='节点表'; 154 +) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8 COMMENT='节点表';
159 155
160 -- ---------------------------- 156 -- ----------------------------
161 -- Records of fa_auth_rule 157 -- Records of fa_auth_rule
@@ -267,7 +263,7 @@ CREATE TABLE `fa_category` ( @@ -267,7 +263,7 @@ CREATE TABLE `fa_category` (
267 PRIMARY KEY (`id`), 263 PRIMARY KEY (`id`),
268 KEY `weigh` (`weigh`,`id`), 264 KEY `weigh` (`weigh`,`id`),
269 KEY `pid` (`pid`) 265 KEY `pid` (`pid`)
270 -) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='分类表'; 266 +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COMMENT='分类表';
271 267
272 -- ---------------------------- 268 -- ----------------------------
273 -- Records of fa_category 269 -- Records of fa_category
@@ -305,13 +301,13 @@ CREATE TABLE `fa_config` ( @@ -305,13 +301,13 @@ CREATE TABLE `fa_config` (
305 `extend` varchar(255) NOT NULL DEFAULT '' COMMENT '扩展属性', 301 `extend` varchar(255) NOT NULL DEFAULT '' COMMENT '扩展属性',
306 PRIMARY KEY (`id`), 302 PRIMARY KEY (`id`),
307 UNIQUE KEY `name` (`name`) 303 UNIQUE KEY `name` (`name`)
308 -) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统配置'; 304 +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='系统配置';
309 305
310 -- ---------------------------- 306 -- ----------------------------
311 -- Records of fa_config 307 -- Records of fa_config
312 -- ---------------------------- 308 -- ----------------------------
313 BEGIN; 309 BEGIN;
314 -INSERT INTO `fa_config` VALUES (1, 'name', 'basic', 'Site name', '请填写站点名称', 'string', 'FastAdmin', '', 'required', ''); 310 +INSERT INTO `fa_config` VALUES (1, 'name', 'basic', 'Site name', '请填写站点名称', 'string', '我的网站', '', 'required', '');
315 INSERT INTO `fa_config` VALUES (2, 'beian', 'basic', 'Beian', '粤ICP备15000000号-1', 'string', '', '', '', ''); 311 INSERT INTO `fa_config` VALUES (2, 'beian', 'basic', 'Beian', '粤ICP备15000000号-1', 'string', '', '', '', '');
316 INSERT INTO `fa_config` VALUES (3, 'cdnurl', 'basic', 'Cdn url', '如果静态资源使用第三方云储存请配置该值', 'string', '', '', '', ''); 312 INSERT INTO `fa_config` VALUES (3, 'cdnurl', 'basic', 'Cdn url', '如果静态资源使用第三方云储存请配置该值', 'string', '', '', '', '');
317 INSERT INTO `fa_config` VALUES (4, 'version', 'basic', 'Version', '如果静态资源有变动请重新配置该值', 'string', '1.0.1', '', 'required', ''); 313 INSERT INTO `fa_config` VALUES (4, 'version', 'basic', 'Version', '如果静态资源有变动请重新配置该值', 'string', '1.0.1', '', 'required', '');
@@ -343,7 +339,7 @@ CREATE TABLE `fa_ems` ( @@ -343,7 +339,7 @@ CREATE TABLE `fa_ems` (
343 `ip` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'IP', 339 `ip` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'IP',
344 `createtime` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '创建时间', 340 `createtime` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '创建时间',
345 PRIMARY KEY (`id`) USING BTREE 341 PRIMARY KEY (`id`) USING BTREE
346 -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='邮箱验证码表'; 342 +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='邮箱验证码表';
347 343
348 -- ---------------------------- 344 -- ----------------------------
349 -- Table structure for fa_sms 345 -- Table structure for fa_sms
@@ -358,7 +354,7 @@ CREATE TABLE `fa_sms` ( @@ -358,7 +354,7 @@ CREATE TABLE `fa_sms` (
358 `ip` varchar(30) NOT NULL DEFAULT '' COMMENT 'IP', 354 `ip` varchar(30) NOT NULL DEFAULT '' COMMENT 'IP',
359 `createtime` int(10) unsigned DEFAULT '0' COMMENT '创建时间', 355 `createtime` int(10) unsigned DEFAULT '0' COMMENT '创建时间',
360 PRIMARY KEY (`id`) 356 PRIMARY KEY (`id`)
361 -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='短信验证码表'; 357 +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='短信验证码表';
362 358
363 -- ---------------------------- 359 -- ----------------------------
364 -- Table structure for fa_test 360 -- Table structure for fa_test
@@ -397,7 +393,7 @@ CREATE TABLE `fa_test` ( @@ -397,7 +393,7 @@ CREATE TABLE `fa_test` (
397 `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态', 393 `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态',
398 `state` enum('0','1','2') NOT NULL DEFAULT '1' COMMENT '状态值:0=禁用,1=正常,2=推荐', 394 `state` enum('0','1','2') NOT NULL DEFAULT '1' COMMENT '状态值:0=禁用,1=正常,2=推荐',
399 PRIMARY KEY (`id`) 395 PRIMARY KEY (`id`)
400 -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='测试表'; 396 +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='测试表';
401 397
402 -- ---------------------------- 398 -- ----------------------------
403 -- Records of fa_test 399 -- Records of fa_test
@@ -443,7 +439,7 @@ CREATE TABLE `fa_user` ( @@ -443,7 +439,7 @@ CREATE TABLE `fa_user` (
443 KEY `username` (`username`), 439 KEY `username` (`username`),
444 KEY `email` (`email`), 440 KEY `email` (`email`),
445 KEY `mobile` (`mobile`) 441 KEY `mobile` (`mobile`)
446 -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='会员表'; 442 +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='会员表';
447 443
448 -- ---------------------------- 444 -- ----------------------------
449 -- Records of fa_user 445 -- Records of fa_user
@@ -464,7 +460,7 @@ CREATE TABLE `fa_user_group` ( @@ -464,7 +460,7 @@ CREATE TABLE `fa_user_group` (
464 `updatetime` int(10) DEFAULT NULL COMMENT '更新时间', 460 `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
465 `status` enum('normal','hidden') DEFAULT NULL COMMENT '状态', 461 `status` enum('normal','hidden') DEFAULT NULL COMMENT '状态',
466 PRIMARY KEY (`id`) 462 PRIMARY KEY (`id`)
467 -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='会员组表'; 463 +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='会员组表';
468 464
469 -- ---------------------------- 465 -- ----------------------------
470 -- Records of fa_user_group 466 -- Records of fa_user_group
@@ -486,7 +482,7 @@ CREATE TABLE `fa_user_money_log` ( @@ -486,7 +482,7 @@ CREATE TABLE `fa_user_money_log` (
486 `memo` varchar(255) NOT NULL DEFAULT '' COMMENT '备注', 482 `memo` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
487 `createtime` int(10) DEFAULT NULL COMMENT '创建时间', 483 `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
488 PRIMARY KEY (`id`) 484 PRIMARY KEY (`id`)
489 -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='会员余额变动表'; 485 +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='会员余额变动表';
490 486
491 -- ---------------------------- 487 -- ----------------------------
492 -- Table structure for fa_user_rule 488 -- Table structure for fa_user_rule
@@ -504,7 +500,7 @@ CREATE TABLE `fa_user_rule` ( @@ -504,7 +500,7 @@ CREATE TABLE `fa_user_rule` (
504 `weigh` int(10) DEFAULT '0' COMMENT '权重', 500 `weigh` int(10) DEFAULT '0' COMMENT '权重',
505 `status` enum('normal','hidden') DEFAULT NULL COMMENT '状态', 501 `status` enum('normal','hidden') DEFAULT NULL COMMENT '状态',
506 PRIMARY KEY (`id`) 502 PRIMARY KEY (`id`)
507 -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='会员规则表'; 503 +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='会员规则表';
508 504
509 -- ---------------------------- 505 -- ----------------------------
510 -- Records of fa_user_rule 506 -- Records of fa_user_rule
@@ -537,7 +533,7 @@ CREATE TABLE `fa_user_score_log` ( @@ -537,7 +533,7 @@ CREATE TABLE `fa_user_score_log` (
537 `memo` varchar(255) NOT NULL DEFAULT '' COMMENT '备注', 533 `memo` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
538 `createtime` int(10) DEFAULT NULL COMMENT '创建时间', 534 `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
539 PRIMARY KEY (`id`) 535 PRIMARY KEY (`id`)
540 -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='会员积分变动表'; 536 +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='会员积分变动表';
541 537
542 -- ---------------------------- 538 -- ----------------------------
543 -- Table structure for fa_user_token 539 -- Table structure for fa_user_token
@@ -549,32 +545,5 @@ CREATE TABLE `fa_user_token` ( @@ -549,32 +545,5 @@ CREATE TABLE `fa_user_token` (
549 `createtime` int(10) DEFAULT NULL COMMENT '创建时间', 545 `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
550 `expiretime` int(10) DEFAULT NULL COMMENT '过期时间', 546 `expiretime` int(10) DEFAULT NULL COMMENT '过期时间',
551 PRIMARY KEY (`token`) 547 PRIMARY KEY (`token`)
552 -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='会员Token表';  
553 -  
554 --- ----------------------------  
555 --- Table structure for fa_version  
556 --- ----------------------------  
557 -DROP TABLE IF EXISTS `fa_version`;  
558 -CREATE TABLE `fa_version` (  
559 - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',  
560 - `oldversion` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '旧版本号',  
561 - `newversion` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '新版本号',  
562 - `packagesize` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '包大小',  
563 - `content` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '升级内容',  
564 - `downloadurl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '下载地址',  
565 - `enforce` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '强制更新',  
566 - `createtime` int(10) NOT NULL DEFAULT 0 COMMENT '创建时间',  
567 - `updatetime` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',  
568 - `weigh` int(10) NOT NULL DEFAULT 0 COMMENT '权重',  
569 - `status` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '状态',  
570 - PRIMARY KEY (`id`) USING BTREE  
571 -) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT = '版本表';  
572 -  
573 --- ----------------------------  
574 --- Table structure for fa_version  
575 --- ----------------------------  
576 -BEGIN;  
577 -INSERT INTO `fa_version` (`id`, `oldversion`, `newversion`, `packagesize`, `content`, `downloadurl`, `enforce`, `createtime`, `updatetime`, `weigh`, `status`) VALUES  
578 -(1, '1.1.1,2', '1.2.1', '20M', '更新内容', 'https://www.fastadmin.net/download.html', 1, 1520425318, 0, 0, 'normal');  
579 -COMMIT; 548 +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会员Token表';
580 SET FOREIGN_KEY_CHECKS = 1; 549 SET FOREIGN_KEY_CHECKS = 1;
  1 +<!doctype html>
  2 +<html>
  3 +<head>
  4 + <meta charset="utf-8">
  5 + <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6 + <title>{:__('Installing FastAdmin')}</title>
  7 + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
  8 + <meta name="renderer" content="webkit">
  9 +
  10 + <style>
  11 + body {
  12 + background: #fff;
  13 + margin: 0;
  14 + padding: 0;
  15 + line-height: 1.5;
  16 + -webkit-font-smoothing: antialiased;
  17 + -moz-osx-font-smoothing: grayscale;
  18 + }
  19 +
  20 + body, input, button {
  21 + font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, 'Microsoft Yahei', Arial, sans-serif;
  22 + font-size: 14px;
  23 + color: #7E96B3;
  24 + }
  25 +
  26 + .container {
  27 + max-width: 480px;
  28 + margin: 0 auto;
  29 + padding: 20px;
  30 + text-align: center;
  31 + }
  32 +
  33 + a {
  34 + color: #18bc9c;
  35 + text-decoration: none;
  36 + }
  37 +
  38 + a:hover {
  39 + text-decoration: underline;
  40 + }
  41 +
  42 + h1 {
  43 + margin-top: 0;
  44 + margin-bottom: 10px;
  45 + }
  46 +
  47 + h2 {
  48 + font-size: 28px;
  49 + font-weight: normal;
  50 + color: #3C5675;
  51 + margin-bottom: 0;
  52 + margin-top: 0;
  53 + }
  54 +
  55 + form {
  56 + margin-top: 40px;
  57 + }
  58 +
  59 + .form-group {
  60 + margin-bottom: 20px;
  61 + }
  62 +
  63 + .form-group .form-field:first-child input {
  64 + border-top-left-radius: 4px;
  65 + border-top-right-radius: 4px;
  66 + }
  67 +
  68 + .form-group .form-field:last-child input {
  69 + border-bottom-left-radius: 4px;
  70 + border-bottom-right-radius: 4px;
  71 + }
  72 +
  73 + .form-field input {
  74 + background: #EDF2F7;
  75 + margin: 0 0 1px;
  76 + border: 2px solid transparent;
  77 + transition: background 0.2s, border-color 0.2s, color 0.2s;
  78 + width: 100%;
  79 + padding: 15px 15px 15px 180px;
  80 + box-sizing: border-box;
  81 + }
  82 +
  83 + .form-field input:focus {
  84 + border-color: #18bc9c;
  85 + background: #fff;
  86 + color: #444;
  87 + outline: none;
  88 + }
  89 +
  90 + .form-field label {
  91 + float: left;
  92 + width: 160px;
  93 + text-align: right;
  94 + margin-right: -160px;
  95 + position: relative;
  96 + margin-top: 15px;
  97 + font-size: 14px;
  98 + pointer-events: none;
  99 + opacity: 0.7;
  100 + }
  101 +
  102 + button, .btn {
  103 + background: #3C5675;
  104 + color: #fff;
  105 + border: 0;
  106 + font-weight: bold;
  107 + border-radius: 4px;
  108 + cursor: pointer;
  109 + padding: 15px 30px;
  110 + -webkit-appearance: none;
  111 + }
  112 +
  113 + button[disabled] {
  114 + opacity: 0.5;
  115 + }
  116 +
  117 + .form-buttons {
  118 + height: 52px;
  119 + line-height: 52px;
  120 + }
  121 +
  122 + .form-buttons .btn {
  123 + margin-right: 5px;
  124 + }
  125 +
  126 + #error, .error, #success, .success, #warmtips, .warmtips {
  127 + background: #D83E3E;
  128 + color: #fff;
  129 + padding: 15px 20px;
  130 + border-radius: 4px;
  131 + margin-bottom: 20px;
  132 + }
  133 +
  134 + #success {
  135 + background: #3C5675;
  136 + }
  137 +
  138 + #error a, .error a {
  139 + color: white;
  140 + text-decoration: underline;
  141 + }
  142 +
  143 + #warmtips {
  144 + background: #ffcdcd;
  145 + font-size: 14px;
  146 + color: #e74c3c;
  147 + }
  148 +
  149 + #warmtips a {
  150 + background: #ffffff7a;
  151 + display: block;
  152 + height: 30px;
  153 + line-height: 30px;
  154 + margin-top: 10px;
  155 + color: #e21a1a;
  156 + border-radius: 3px;
  157 + }
  158 + </style>
  159 +</head>
  160 +
  161 +<body>
  162 +<div class="container">
  163 + <h1>
  164 + <svg width="80px" height="96px" viewBox="0 0 768 830" version="1.1" xmlns="http://www.w3.org/2000/svg"
  165 + xmlns:xlink="http://www.w3.org/1999/xlink">
  166 + <g id="logo" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
  167 + <path d="M64.433651,605.899968 C20.067302,536.265612 0,469.698785 0,389.731348 C0,174.488668 171.922656,0 384,0 C596.077344,0 768,174.488668 768,389.731348 C768,469.698785 747.932698,536.265612 703.566349,605.899968 C614.4,753.480595 441.6,870.4 384,870.4 C326.4,870.4 153.6,753.480595 64.433651,605.899968 L64.433651,605.899968 Z"
  168 + id="body" fill="#18BC9C"></path>
  169 + <path d="M429.648991,190.816 L430.160991,190.816 L429.648991,190.816 L429.648991,190.816 Z M429.648991,156 L427.088991,156 C419.408991,157.024 411.728991,160.608 404.560991,168.8 L403.024991,170.848 L206.928991,429.92 C198.736991,441.184 197.712991,453.984 204.368991,466.784 C210.512991,478.048 222.288991,485.728 235.600991,485.728 L336.464991,486.24 L304.208991,673.632 C301.648991,689.504 310.352991,705.376 325.200991,712.032 C329.808991,714.08 334.416991,714.592 339.536991,714.592 C349.776991,714.592 358.992991,709.472 366.160991,700.256 L561.744991,419.168 C569.936991,407.904 570.960991,395.104 564.304991,382.304 C557.648991,369.504 547.408991,363.36 533.072991,363.36 L432.208991,363.36 L463.952991,199.008 C464.464991,196.448 464.976991,193.376 464.976991,190.816 C464.976991,171.872 449.104991,156 431.184991,156 L429.648991,156 L429.648991,156 Z"
  170 + id="flash" fill="#FFFFFF"></path>
  171 + </g>
  172 + </svg>
  173 + </h1>
  174 + <h2>{:__('Installing FastAdmin')}</h2>
  175 + <div>
  176 +
  177 + <form method="post">
  178 + {if $errInfo}
  179 + <div class="error">
  180 + {$errInfo}
  181 + </div>
  182 + {/if}
  183 + <div id="error" style="display:none"></div>
  184 + <div id="success" style="display:none"></div>
  185 + <div id="warmtips" style="display:none"></div>
  186 +
  187 + <div class="form-group">
  188 + <div class="form-field">
  189 + <label>{:__('Mysql Hostname')}</label>
  190 + <input type="text" name="mysqlHostname" value="127.0.0.1" required="">
  191 + </div>
  192 +
  193 + <div class="form-field">
  194 + <label>{:__('Mysql Database')}</label>
  195 + <input type="text" name="mysqlDatabase" value="" required="">
  196 + </div>
  197 +
  198 + <div class="form-field">
  199 + <label>{:__('Mysql Username')}</label>
  200 + <input type="text" name="mysqlUsername" value="root" required="">
  201 + </div>
  202 +
  203 + <div class="form-field">
  204 + <label>{:__('Mysql Password')}</label>
  205 + <input type="password" name="mysqlPassword">
  206 + </div>
  207 +
  208 + <div class="form-field">
  209 + <label>{:__('Mysql Prefix')}</label>
  210 + <input type="text" name="mysqlPrefix" value="fa_">
  211 + </div>
  212 +
  213 + <div class="form-field">
  214 + <label>{:__('Mysql Hostport')}</label>
  215 + <input type="number" name="mysqlHostport" value="3306">
  216 + </div>
  217 + </div>
  218 +
  219 + <div class="form-group">
  220 + <div class="form-field">
  221 + <label>{:__('Admin Username')}</label>
  222 + <input name="adminUsername" value="admin" required=""/>
  223 + </div>
  224 +
  225 + <div class="form-field">
  226 + <label>{:__('Admin Email')}</label>
  227 + <input name="adminEmail" value="admin@admin.com" required="">
  228 + </div>
  229 +
  230 + <div class="form-field">
  231 + <label>{:__('Admin Password')}</label>
  232 + <input type="password" name="adminPassword" required="">
  233 + </div>
  234 +
  235 + <div class="form-field">
  236 + <label>{:__('Repeat Password')}</label>
  237 + <input type="password" name="adminPasswordConfirmation" required="">
  238 + </div>
  239 + </div>
  240 +
  241 + <div class="form-group">
  242 + <div class="form-field">
  243 + <label>{:__('Website')}</label>
  244 + <input type="text" name="siteName" value="{:__('My Website')}" required=""/>
  245 + </div>
  246 +
  247 + </div>
  248 +
  249 + <div class="form-buttons">
  250 + <!--@formatter:off-->
  251 + <button type="submit" {:$errInfo?'disabled':''}>{:__('Install now')}</button>
  252 + <!--@formatter:on-->
  253 + </div>
  254 + </form>
  255 +
  256 + <!-- jQuery -->
  257 + <script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
  258 +
  259 + <script>
  260 + $(function () {
  261 + $('form :input:first').select();
  262 +
  263 + $('form').on('submit', function (e) {
  264 + e.preventDefault();
  265 + var form = this;
  266 + var $error = $("#error");
  267 + var $success = $("#success");
  268 + var $button = $(this).find('button')
  269 + .text("{:__('Installing')}")
  270 + .prop('disabled', true);
  271 + $.ajax({
  272 + url: "",
  273 + type: "POST",
  274 + dataType: "json",
  275 + data: $(this).serialize(),
  276 + success: function (ret) {
  277 + if (ret.code == 1) {
  278 + var data = ret.data;
  279 + $error.hide();
  280 + $(".form-group", form).remove();
  281 + $button.remove();
  282 + $("#success").text(ret.msg).show();
  283 +
  284 + $buttons = $(".form-buttons", form);
  285 + $("<a class='btn' href='./'>{:__('Home')}</a>").appendTo($buttons);
  286 +
  287 + if (typeof data.adminName !== 'undefined') {
  288 + var url = location.href.replace(/install\.php/, data.adminName);
  289 + $("#warmtips").html("{:__('Security tips')}" + '<a href="' + url + '">' + url + '</a>').show();
  290 + $('<a class="btn" href="' + url + '" id="btn-admin" style="background:#18bc9c">' + "{:__('Dashboard')}" + '</a>').appendTo($buttons);
  291 + }
  292 + localStorage.setItem("fastep", "installed");
  293 + } else {
  294 + $error.show().text(ret.msg);
  295 + $button.prop('disabled', false).text("{:__('Install now')}");
  296 + $("html,body").animate({
  297 + scrollTop: 0
  298 + }, 500);
  299 + }
  300 + },
  301 + error: function (xhr) {
  302 + $error.show().text(xhr.responseText);
  303 + $button.prop('disabled', false).text("{:__('Install now')}");
  304 + $("html,body").animate({
  305 + scrollTop: 0
  306 + }, 500);
  307 + }
  308 + });
  309 + return false;
  310 + });
  311 + });
  312 + </script>
  313 + </div>
  314 +</div>
  315 +</body>
  316 +</html>
  1 +<?php
  2 +return [
  3 + 'Warning' => '温馨提示',
  4 + 'Installing FastAdmin' => '安装FastAdmin',
  5 + 'Mysql Hostname' => 'MySQL 数据库地址',
  6 + 'Mysql Database' => 'MySQL 数据库名',
  7 + 'Mysql Username' => 'MySQL 用户名',
  8 + 'Mysql Password' => 'MySQL 密码',
  9 + 'Mysql Prefix' => 'MySQL 数据表前缀',
  10 + 'Mysql Hostport' => 'MySQL 端口号',
  11 + 'Admin Username' => '管理者用户名',
  12 + 'Admin Email' => '管理者Email',
  13 + 'Admin Password' => '管理者密码',
  14 + 'Repeat Password' => '重复密码',
  15 + 'Website' => '网站名称',
  16 + 'My Website' => '我的网站',
  17 + 'Install now' => '点击安装',
  18 + 'Installing' => '安装中...',
  19 + 'Home' => '访问首页',
  20 + 'Dashboard' => '进入后台',
  21 + 'Go back' => '返回上一页',
  22 + 'Install Successed' => '安装成功!',
  23 + 'Security tips' => '温馨提示:请将以下后台登录入口添加到你的收藏夹,为了你的安全,不要泄漏或发送给他人!如有泄漏请及时修改!',
  24 + 'Please input correct database' => '请输入正确的数据库名',
  25 + 'Please input correct username' => '用户名只能由3-12位数字、字母、下划线组合',
  26 + 'Please input correct password' => '密码长度必须在6-16位之间,不能包含空格',
  27 + 'The two passwords you entered did not match' => '两次输入的密码不一致',
  28 + 'Please input correct website' => '网站名称输入不正确',
  29 + 'The current version %s is too low, please use PHP 5.5 or higher' => '当前版本%s过低,请使用PHP5.5以上版本',
  30 + 'PDO is not currently installed and cannot be installed' => '当前未开启PDO,无法进行安装',
  31 + 'The current permissions are insufficient to write the file %s' => '当前权限不足,无法写入文件%s',
  32 + 'Please go to the official website to download the full package or resource package and try to install' => '当前代码仅包含核心代码,请前往官网下载完整包或资源包覆盖后再尝试安装',
  33 + 'The system has been installed. If you need to reinstall, please remove %s first' => '当前已经安装成功,如果需要重新安装,请手动移除%s文件',
  34 +];
@@ -203,14 +203,18 @@ class Menu extends Command @@ -203,14 +203,18 @@ class Menu extends Command
203 $tempClassFile = __DIR__ . DS . $uniqueName . ".php"; 203 $tempClassFile = __DIR__ . DS . $uniqueName . ".php";
204 file_put_contents($tempClassFile, $classContent); 204 file_put_contents($tempClassFile, $classContent);
205 $className = "\\app\\admin\\command\\" . $uniqueName; 205 $className = "\\app\\admin\\command\\" . $uniqueName;
  206 +
  207 + //删除临时文件
  208 + register_shutdown_function(function () use ($tempClassFile) {
  209 + if ($tempClassFile) {
  210 + //删除临时文件
  211 + @unlink($tempClassFile);
  212 + }
  213 + });
  214 +
206 //反射机制调用类的注释和方法名 215 //反射机制调用类的注释和方法名
207 $reflector = new ReflectionClass($className); 216 $reflector = new ReflectionClass($className);
208 217
209 - if (isset($tempClassFile)) {  
210 - //删除临时文件  
211 - @unlink($tempClassFile);  
212 - }  
213 -  
214 //只匹配公共的方法 218 //只匹配公共的方法
215 $methods = $reflector->getMethods(ReflectionMethod::IS_PUBLIC); 219 $methods = $reflector->getMethods(ReflectionMethod::IS_PUBLIC);
216 $classComment = $reflector->getDocComment(); 220 $classComment = $reflector->getDocComment();
@@ -10,9 +10,9 @@ if (!function_exists('build_select')) { @@ -10,9 +10,9 @@ if (!function_exists('build_select')) {
10 /** 10 /**
11 * 生成下拉列表 11 * 生成下拉列表
12 * @param string $name 12 * @param string $name
13 - * @param mixed $options  
14 - * @param mixed $selected  
15 - * @param mixed $attr 13 + * @param mixed $options
  14 + * @param mixed $selected
  15 + * @param mixed $attr
16 * @return string 16 * @return string
17 */ 17 */
18 function build_select($name, $options, $selected = [], $attr = []) 18 function build_select($name, $options, $selected = [], $attr = [])
@@ -28,8 +28,8 @@ if (!function_exists('build_radios')) { @@ -28,8 +28,8 @@ if (!function_exists('build_radios')) {
28 /** 28 /**
29 * 生成单选按钮组 29 * 生成单选按钮组
30 * @param string $name 30 * @param string $name
31 - * @param array $list  
32 - * @param mixed $selected 31 + * @param array $list
  32 + * @param mixed $selected
33 * @return string 33 * @return string
34 */ 34 */
35 function build_radios($name, $list = [], $selected = null) 35 function build_radios($name, $list = [], $selected = null)
@@ -49,8 +49,8 @@ if (!function_exists('build_checkboxs')) { @@ -49,8 +49,8 @@ if (!function_exists('build_checkboxs')) {
49 /** 49 /**
50 * 生成复选按钮组 50 * 生成复选按钮组
51 * @param string $name 51 * @param string $name
52 - * @param array $list  
53 - * @param mixed $selected 52 + * @param array $list
  53 + * @param mixed $selected
54 * @return string 54 * @return string
55 */ 55 */
56 function build_checkboxs($name, $list = [], $selected = null) 56 function build_checkboxs($name, $list = [], $selected = null)
@@ -72,9 +72,9 @@ if (!function_exists('build_category_select')) { @@ -72,9 +72,9 @@ if (!function_exists('build_category_select')) {
72 * 生成分类下拉列表框 72 * 生成分类下拉列表框
73 * @param string $name 73 * @param string $name
74 * @param string $type 74 * @param string $type
75 - * @param mixed $selected  
76 - * @param array $attr  
77 - * @param array $header 75 + * @param mixed $selected
  76 + * @param array $attr
  77 + * @param array $header
78 * @return string 78 * @return string
79 */ 79 */
80 function build_category_select($name, $type, $selected = null, $attr = [], $header = []) 80 function build_category_select($name, $type, $selected = null, $attr = [], $header = [])
@@ -194,3 +194,33 @@ if (!function_exists('build_heading')) { @@ -194,3 +194,33 @@ if (!function_exists('build_heading')) {
194 return $result; 194 return $result;
195 } 195 }
196 } 196 }
  197 +
  198 +if (!function_exists('build_suffix_image')) {
  199 + /**
  200 + * 生成文件后缀图片
  201 + * @param string $suffix 后缀
  202 + * @param null $background
  203 + * @return string
  204 + */
  205 + function build_suffix_image($suffix, $background = null)
  206 + {
  207 + $suffix = mb_substr(strtoupper($suffix), 0, 4);
  208 + $total = unpack('L', hash('adler32', $suffix, true))[1];
  209 + $hue = $total % 360;
  210 + list($r, $g, $b) = hsv2rgb($hue / 360, 0.3, 0.9);
  211 +
  212 + $background = $background ? $background : "rgb({$r},{$g},{$b})";
  213 +
  214 + $icon = <<<EOT
  215 + <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">
  216 + <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"/>
  217 + <path style="fill:#B0B7BD;" d="M384,128h96L352,0v96C352,113.6,366.4,128,384,128z"/>
  218 + <polygon style="fill:#CAD1D8;" points="480,224 384,128 480,128 "/>
  219 + <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"/>
  220 + <path style="fill:#CAD1D8;" d="M400,432H96v16h304c8.8,0,16-7.2,16-16v-16C416,424.8,408.8,432,400,432z"/>
  221 + <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>
  222 + </svg>
  223 +EOT;
  224 + return $icon;
  225 + }
  226 +}
@@ -39,7 +39,7 @@ class Addon extends Backend @@ -39,7 +39,7 @@ class Addon extends Backend
39 $v['config'] = $config ? 1 : 0; 39 $v['config'] = $config ? 1 : 0;
40 $v['url'] = str_replace($this->request->server('SCRIPT_NAME'), '', $v['url']); 40 $v['url'] = str_replace($this->request->server('SCRIPT_NAME'), '', $v['url']);
41 } 41 }
42 - $this->assignconfig(['addons' => $addons]); 42 + $this->assignconfig(['addons' => $addons, 'api_url' => config('fastadmin.api_url'), 'faversion' => config('fastadmin.version')]);
43 return $this->view->fetch(); 43 return $this->view->fetch();
44 } 44 }
45 45
@@ -36,6 +36,12 @@ class Ajax extends Backend @@ -36,6 +36,12 @@ class Ajax extends Backend
36 public function lang() 36 public function lang()
37 { 37 {
38 header('Content-Type: application/javascript'); 38 header('Content-Type: application/javascript');
  39 + header("Cache-Control: public");
  40 + header("Pragma: cache");
  41 +
  42 + $offset = 30 * 60 * 60 * 24; // 缓存一个月
  43 + header("Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT");
  44 +
39 $controllername = input("controllername"); 45 $controllername = input("controllername");
40 //默认只加载了控制器对应的语言名,你还根据控制器名来加载额外的语言包 46 //默认只加载了控制器对应的语言名,你还根据控制器名来加载额外的语言包
41 $this->loadlang($controllername); 47 $this->loadlang($controllername);
@@ -290,4 +296,16 @@ class Ajax extends Backend @@ -290,4 +296,16 @@ class Ajax extends Backend
290 $this->success('', null, $provincelist); 296 $this->success('', null, $provincelist);
291 } 297 }
292 298
  299 + /**
  300 + * 生成后缀图标
  301 + */
  302 + public function icon()
  303 + {
  304 + $suffix = $this->request->request("suffix");
  305 + header('Content-type: image/svg+xml');
  306 + $suffix = $suffix ? $suffix : "FILE";
  307 + echo build_suffix_image($suffix);
  308 + exit;
  309 + }
  310 +
293 } 311 }
@@ -10,7 +10,7 @@ use think\Cache; @@ -10,7 +10,7 @@ use think\Cache;
10 /** 10 /**
11 * 规则管理 11 * 规则管理
12 * 12 *
13 - * @icon fa fa-list 13 + * @icon fa fa-list
14 * @remark 规则通常对应一个控制器的方法,同时左侧的菜单栏数据也从规则中体现,通常建议通过控制台进行生成规则节点 14 * @remark 规则通常对应一个控制器的方法,同时左侧的菜单栏数据也从规则中体现,通常建议通过控制台进行生成规则节点
15 */ 15 */
16 class Rule extends Backend 16 class Rule extends Backend
@@ -26,15 +26,14 @@ class Rule extends Backend @@ -26,15 +26,14 @@ class Rule extends Backend
26 public function _initialize() 26 public function _initialize()
27 { 27 {
28 parent::_initialize(); 28 parent::_initialize();
29 - if (!$this->auth->isSuperAdmin()){ 29 + if (!$this->auth->isSuperAdmin()) {
30 $this->error(__('Access is allowed only to the super management group')); 30 $this->error(__('Access is allowed only to the super management group'));
31 } 31 }
32 $this->model = model('AuthRule'); 32 $this->model = model('AuthRule');
33 // 必须将结果集转换为数组 33 // 必须将结果集转换为数组
34 - $ruleList = collection($this->model->order('weigh', 'desc')->order('id', 'asc')->select())->toArray(); 34 + $ruleList = collection($this->model->field('condition,remark,createtime,updatetime', true)->order('weigh DESC,id ASC')->select())->toArray();
35 foreach ($ruleList as $k => &$v) { 35 foreach ($ruleList as $k => &$v) {
36 $v['title'] = __($v['title']); 36 $v['title'] = __($v['title']);
37 - $v['remark'] = __($v['remark']);  
38 } 37 }
39 unset($v); 38 unset($v);
40 Tree::instance()->init($ruleList); 39 Tree::instance()->init($ruleList);
@@ -7,7 +7,7 @@ use app\common\controller\Backend; @@ -7,7 +7,7 @@ use app\common\controller\Backend;
7 /** 7 /**
8 * 附件管理 8 * 附件管理
9 * 9 *
10 - * @icon fa fa-circle-o 10 + * @icon fa fa-circle-o
11 * @remark 主要用于管理上传到又拍云的数据或上传至本服务的上传数据 11 * @remark 主要用于管理上传到又拍云的数据或上传至本服务的上传数据
12 */ 12 */
13 class Attachment extends Backend 13 class Attachment extends Backend
@@ -22,6 +22,7 @@ class Attachment extends Backend @@ -22,6 +22,7 @@ class Attachment extends Backend
22 { 22 {
23 parent::_initialize(); 23 parent::_initialize();
24 $this->model = model('Attachment'); 24 $this->model = model('Attachment');
  25 + $this->view->assign("mimetypeList", \app\common\model\Attachment::getMimetypeList());
25 } 26 }
26 27
27 /** 28 /**
@@ -34,13 +35,17 @@ class Attachment extends Backend @@ -34,13 +35,17 @@ class Attachment extends Backend
34 if ($this->request->isAjax()) { 35 if ($this->request->isAjax()) {
35 $mimetypeQuery = []; 36 $mimetypeQuery = [];
36 $filter = $this->request->request('filter'); 37 $filter = $this->request->request('filter');
37 - $filterArr = (array)json_decode($filter, TRUE);  
38 - if (isset($filterArr['mimetype']) && stripos($filterArr['mimetype'], ',') !== false) { 38 + $filterArr = (array)json_decode($filter, true);
  39 + if (isset($filterArr['mimetype']) && preg_match("/[]\,|\*]/", $filterArr['mimetype'])) {
39 $this->request->get(['filter' => json_encode(array_diff_key($filterArr, ['mimetype' => '']))]); 40 $this->request->get(['filter' => json_encode(array_diff_key($filterArr, ['mimetype' => '']))]);
40 $mimetypeQuery = function ($query) use ($filterArr) { 41 $mimetypeQuery = function ($query) use ($filterArr) {
41 $mimetypeArr = explode(',', $filterArr['mimetype']); 42 $mimetypeArr = explode(',', $filterArr['mimetype']);
42 foreach ($mimetypeArr as $index => $item) { 43 foreach ($mimetypeArr as $index => $item) {
43 - $query->whereOr('mimetype', 'like', '%' . $item . '%'); 44 + if (stripos($item, "/*") !== false) {
  45 + $query->whereOr('mimetype', 'like', str_replace("/*", "/", $item) . '%');
  46 + } else {
  47 + $query->whereOr('mimetype', 'like', '%' . $item . '%');
  48 + }
44 } 49 }
45 }; 50 };
46 } 51 }
@@ -11,7 +11,7 @@ use think\Validate; @@ -11,7 +11,7 @@ use think\Validate;
11 /** 11 /**
12 * 系统配置 12 * 系统配置
13 * 13 *
14 - * @icon fa fa-cogs 14 + * @icon fa fa-cogs
15 * @remark 可以在此增改系统的变量和分组,也可以自定义分组和变量,如果需要删除请从数据库中删除 15 * @remark 可以在此增改系统的变量和分组,也可以自定义分组和变量,如果需要删除请从数据库中删除
16 */ 16 */
17 class Config extends Backend 17 class Config extends Backend
@@ -27,6 +27,11 @@ class Config extends Backend @@ -27,6 +27,11 @@ class Config extends Backend
27 { 27 {
28 parent::_initialize(); 28 parent::_initialize();
29 $this->model = model('Config'); 29 $this->model = model('Config');
  30 + ConfigModel::event('before_write', function ($row) {
  31 + if (isset($row['name']) && $row['name'] == 'name' && preg_match("/fast" . "admin/i", $row['value'])) {
  32 + throw new Exception(__("Site name incorrect"));
  33 + }
  34 + });
30 } 35 }
31 36
32 /** 37 /**
@@ -79,26 +84,26 @@ class Config extends Backend @@ -79,26 +84,26 @@ class Config extends Backend
79 foreach ($params as $k => &$v) { 84 foreach ($params as $k => &$v) {
80 $v = is_array($v) ? implode(',', $v) : $v; 85 $v = is_array($v) ? implode(',', $v) : $v;
81 } 86 }
  87 + if (in_array($params['type'], ['select', 'selects', 'checkbox', 'radio', 'array'])) {
  88 + $params['content'] = json_encode(ConfigModel::decode($params['content']), JSON_UNESCAPED_UNICODE);
  89 + } else {
  90 + $params['content'] = '';
  91 + }
82 try { 92 try {
83 - if (in_array($params['type'], ['select', 'selects', 'checkbox', 'radio', 'array'])) {  
84 - $params['content'] = json_encode(ConfigModel::decode($params['content']), JSON_UNESCAPED_UNICODE);  
85 - } else {  
86 - $params['content'] = '';  
87 - }  
88 $result = $this->model->create($params); 93 $result = $this->model->create($params);
89 - if ($result !== false) {  
90 - try {  
91 - $this->refreshFile();  
92 - } catch (Exception $e) {  
93 - $this->error($e->getMessage());  
94 - }  
95 - $this->success();  
96 - } else {  
97 - $this->error($this->model->getError());  
98 - }  
99 } catch (Exception $e) { 94 } catch (Exception $e) {
100 $this->error($e->getMessage()); 95 $this->error($e->getMessage());
101 } 96 }
  97 + if ($result !== false) {
  98 + try {
  99 + $this->refreshFile();
  100 + } catch (Exception $e) {
  101 + $this->error($e->getMessage());
  102 + }
  103 + $this->success();
  104 + } else {
  105 + $this->error($this->model->getError());
  106 + }
102 } 107 }
103 $this->error(__('Parameter %s can not be empty', '')); 108 $this->error(__('Parameter %s can not be empty', ''));
104 } 109 }
@@ -128,7 +133,11 @@ class Config extends Backend @@ -128,7 +133,11 @@ class Config extends Backend
128 $configList[] = $v->toArray(); 133 $configList[] = $v->toArray();
129 } 134 }
130 } 135 }
131 - $this->model->allowField(true)->saveAll($configList); 136 + try {
  137 + $this->model->allowField(true)->saveAll($configList);
  138 + } catch (Exception $e) {
  139 + $this->error($e->getMessage());
  140 + }
132 try { 141 try {
133 $this->refreshFile(); 142 $this->refreshFile();
134 } catch (Exception $e) { 143 } catch (Exception $e) {
@@ -172,10 +172,10 @@ return [ @@ -172,10 +172,10 @@ return [
172 'Second group 2' => '二级管理组2', 172 'Second group 2' => '二级管理组2',
173 'Third group 2' => '三级管理组2', 173 'Third group 2' => '三级管理组2',
174 'Dashboard tips' => '用于展示当前系统中的统计数据、统计报表及重要实时数据', 174 'Dashboard tips' => '用于展示当前系统中的统计数据、统计报表及重要实时数据',
175 - 'Config tips' => '可以在此增改系统的变量和分组,也可以自定义分组和变量,如果需要删除请从数据库中删除', 175 + 'Config tips' => '可以在此增改系统的变量和分组,也可以自定义分组和变量',
176 'Category tips' => '用于统一管理网站的所有分类,分类可进行无限级分类,分类类型请在常规管理->系统配置->字典配置中添加', 176 'Category tips' => '用于统一管理网站的所有分类,分类可进行无限级分类,分类类型请在常规管理->系统配置->字典配置中添加',
177 'Attachment tips' => '主要用于管理上传到服务器或第三方存储的数据', 177 'Attachment tips' => '主要用于管理上传到服务器或第三方存储的数据',
178 - 'Addon tips' => '可在线安装、卸载、禁用、启用插件,同时支持添加本地插件。FastAdmin已上线插件商店 ,你可以发布你的免费或付费插件:<a href="https://www.fastadmin.net/store.html" target="_blank">https://www.fastadmin.net/store.html</a>', 178 + 'Addon tips' => '可在线安装、卸载、禁用、启用插件,同时支持添加本地插件。',
179 'Admin tips' => '一个管理员可以有多个角色组,左侧的菜单根据管理员所拥有的权限进行生成', 179 'Admin tips' => '一个管理员可以有多个角色组,左侧的菜单根据管理员所拥有的权限进行生成',
180 'Admin log tips' => '管理员可以查看自己所拥有的权限的管理员日志', 180 'Admin log tips' => '管理员可以查看自己所拥有的权限的管理员日志',
181 'Group tips' => '角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别的下级角色组或管理员', 181 'Group tips' => '角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别的下级角色组或管理员',
@@ -18,18 +18,18 @@ return [ @@ -18,18 +18,18 @@ return [
18 'Conflict tips' => '此插件中发现和现有系统中部分文件发现冲突!以下文件将会被影响,请备份好相关文件后再继续操作', 18 'Conflict tips' => '此插件中发现和现有系统中部分文件发现冲突!以下文件将会被影响,请备份好相关文件后再继续操作',
19 'Login tips' => '此处登录账号为<a href="https://www.fastadmin.net" target="_blank">FastAdmin官网账号</a>', 19 'Login tips' => '此处登录账号为<a href="https://www.fastadmin.net" target="_blank">FastAdmin官网账号</a>',
20 'Logined tips' => '你好!%s<br />当前你已经登录,将同步保存你的购买记录', 20 'Logined tips' => '你好!%s<br />当前你已经登录,将同步保存你的购买记录',
21 - 'Pay tips' => '扫码支付后如果仍然无法立即下载,请不要重复支付,请加<a href="https://jq.qq.com/?_wv=1027&k=487PNBb" target="_blank">QQ群:636393962</a>向管理员反馈', 21 + 'Pay tips' => '扫码支付后如果仍然无法立即下载,请不要重复支付,请稍后再重试安装!',
22 'Pay click tips' => '请点击这里在新窗口中进行支付!', 22 'Pay click tips' => '请点击这里在新窗口中进行支付!',
23 'Pay new window tips' => '请在新弹出的窗口中进行支付,支付完成后再重新点击安装按钮进行安装!', 23 'Pay new window tips' => '请在新弹出的窗口中进行支付,支付完成后再重新点击安装按钮进行安装!',
24 'Uninstall tips' => '确认卸载<b>[%s]</b>?<p class="text-danger">卸载将会删除所有插件文件且不可找回!!! 插件如果有创建数据库表请手动删除!!!</p>如有重要数据请备份后再操作!', 24 'Uninstall tips' => '确认卸载<b>[%s]</b>?<p class="text-danger">卸载将会删除所有插件文件且不可找回!!! 插件如果有创建数据库表请手动删除!!!</p>如有重要数据请备份后再操作!',
25 - 'Upgrade tips' => '确认升级<b>[%s]</b>?<p class="text-danger">如果之前购买插件时未登录,此次升级可能出现购买后才可以下载的提示!!!<br>升级后可能出现部分冗余数据记录,请根据需要移除即可!!!</p>如有重要数据请备份后再操作!', 25 + 'Upgrade tips' => '确认升级<b>[%s]</b>?<p class="text-danger">升级后可能出现部分冗余数据记录,请根据需要移除即可!!!</p>如有重要数据请备份后再操作!',
26 'Offline installed tips' => '插件安装成功!清除浏览器缓存和框架缓存后生效!', 26 'Offline installed tips' => '插件安装成功!清除浏览器缓存和框架缓存后生效!',
27 'Online installed tips' => '插件安装成功!清除浏览器缓存和框架缓存后生效!', 27 'Online installed tips' => '插件安装成功!清除浏览器缓存和框架缓存后生效!',
28 'Not login tips' => '你当前未登录FastAdmin,登录后将同步已购买的记录,下载时无需二次付费!', 28 'Not login tips' => '你当前未登录FastAdmin,登录后将同步已购买的记录,下载时无需二次付费!',
29 'Not installed tips' => '请安装后再访问插件前台页面!', 29 'Not installed tips' => '请安装后再访问插件前台页面!',
30 'Not enabled tips' => '插件已经禁用,请启用后再访问插件前台页面!', 30 'Not enabled tips' => '插件已经禁用,请启用后再访问插件前台页面!',
31 'New version tips' => '发现新版本:%s 点击查看更新日志', 31 'New version tips' => '发现新版本:%s 点击查看更新日志',
32 - 'Store now available tips' => 'FastAdmin插件市场暂不可用,是否切换到本地插件?', 32 + 'Store now available tips' => '插件市场暂不可用,是否切换到本地插件?',
33 'Switch to the local' => '切换到本地插件', 33 'Switch to the local' => '切换到本地插件',
34 'try to reload' => '重新尝试加载', 34 'try to reload' => '重新尝试加载',
35 'Please disable addon first' => '请先禁用插件再进行升级', 35 'Please disable addon first' => '请先禁用插件再进行升级',
@@ -74,7 +74,7 @@ return [ @@ -74,7 +74,7 @@ return [
74 'Enable' => '启用', 74 'Enable' => '启用',
75 'Your username or email' => '你的手机号、用户名或邮箱', 75 'Your username or email' => '你的手机号、用户名或邮箱',
76 'Your password' => '你的密码', 76 'Your password' => '你的密码',
77 - 'Login FastAdmin' => '登录FastAdmin', 77 + 'Login FastAdmin' => '登录',
78 'Login' => '登录', 78 'Login' => '登录',
79 'Logout' => '退出登录', 79 'Logout' => '退出登录',
80 'Register' => '注册账号', 80 'Register' => '注册账号',
@@ -44,5 +44,4 @@ return [ @@ -44,5 +44,4 @@ return [
44 'Timezone' => '时区', 44 'Timezone' => '时区',
45 'Language' => '语言', 45 'Language' => '语言',
46 'View more' => '查看更多', 46 'View more' => '查看更多',
47 - 'Security tips' => '<i class="fa fa-warning"></i> 安全提示:你正在使用默认的后台登录入口,为了你的网站安全,强烈建议你修改后台登录入口,<a href="https://forum.fastadmin.net/thread/7640" target="_blank">点击查看修改方法</a>',  
48 ]; 47 ];
@@ -55,6 +55,7 @@ return [ @@ -55,6 +55,7 @@ return [
55 'Mail smtp password' => 'SMTP密码', 55 'Mail smtp password' => 'SMTP密码',
56 'Mail vertify type' => 'SMTP验证方式', 56 'Mail vertify type' => 'SMTP验证方式',
57 'Mail from' => '发件人邮箱', 57 'Mail from' => '发件人邮箱',
  58 + 'Site name incorrect' => '网站名称错误',
58 'Name already exist' => '变量名称已经存在', 59 'Name already exist' => '变量名称已经存在',
59 'Add new config' => '点击添加新的配置', 60 'Add new config' => '点击添加新的配置',
60 'Send a test message' => '发送测试邮件', 61 'Send a test message' => '发送测试邮件',
@@ -63,11 +63,12 @@ @@ -63,11 +63,12 @@
63 <div class="panel panel-default panel-intro"> 63 <div class="panel panel-default panel-intro">
64 <div class="panel-heading"> 64 <div class="panel-heading">
65 {:build_heading(null,FALSE)} 65 {:build_heading(null,FALSE)}
  66 + {if $Think.config.fastadmin.api_url}
66 <ul class="nav nav-tabs nav-category"> 67 <ul class="nav nav-tabs nav-category">
67 <li class="active"><a href="javascript:;" data-id="">{:__('All')}</a></li> 68 <li class="active"><a href="javascript:;" data-id="">{:__('All')}</a></li>
68 <li><a href="javascript:;" data-id="0">{:__('Uncategoried')}</a></li> 69 <li><a href="javascript:;" data-id="0">{:__('Uncategoried')}</a></li>
69 </ul> 70 </ul>
70 - 71 + {/if}
71 </div> 72 </div>
72 73
73 <div class="panel-body"> 74 <div class="panel-body">
@@ -76,25 +77,18 @@ @@ -76,25 +77,18 @@
76 <div class="widget-body no-padding"> 77 <div class="widget-body no-padding">
77 <div id="toolbar" class="toolbar"> 78 <div id="toolbar" class="toolbar">
78 {:build_toolbar('refresh')} 79 {:build_toolbar('refresh')}
79 - <button type="button" id="plupload-addon" class="btn btn-danger plupload" data-url="addon/local"  
80 - data-mimetype="application/zip" data-multiple="false"><i class="fa fa-upload"></i> 80 + <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>
81 {:__('Offline install')} 81 {:__('Offline install')}
82 </button> 82 </button>
  83 + {if $Think.config.fastadmin.api_url}
83 <div class="btn-group"> 84 <div class="btn-group">
84 - <a href="#" class="btn btn-info btn-switch active" data-type="all"  
85 - data-url="{$config.fastadmin.api_url}/addon/index"><i class="fa fa-list"></i>  
86 - {:__('All')}</a>  
87 - <a href="#" class="btn btn-info btn-switch" data-type="free"  
88 - data-url="{$config.fastadmin.api_url}/addon/index"><i class="fa fa-gift"></i>  
89 - {:__('Free')}</a>  
90 - <a href="#" class="btn btn-info btn-switch" data-type="price"  
91 - data-url="{$config.fastadmin.api_url}/addon/index"><i class="fa fa-rmb"></i>  
92 - {:__('Paying')}</a>  
93 - <a href="#" class="btn btn-info btn-switch" data-type="local" data-url="addon/downloaded"><i  
94 - class="fa fa-laptop"></i> {:__('Local addon')}</a> 85 + <a href="#" class="btn btn-info btn-switch active" data-type="all"><i class="fa fa-list"></i> {:__('All')}</a>
  86 + <a href="#" class="btn btn-info btn-switch" data-type="free"><i class="fa fa-gift"></i> {:__('Free')}</a>
  87 + <a href="#" class="btn btn-info btn-switch" data-type="price"><i class="fa fa-rmb"></i> {:__('Paying')}</a>
  88 + <a href="#" class="btn btn-info btn-switch" data-type="local" data-url="addon/downloaded"><i class="fa fa-laptop"></i> {:__('Local addon')}</a>
95 </div> 89 </div>
96 - <a class="btn btn-primary btn-userinfo" href="javascript:;"><i class="fa fa-user"></i>  
97 - {:__('Userinfo')}</a> 90 + <a class="btn btn-primary btn-userinfo" href="javascript:;"><i class="fa fa-user"></i> {:__('Userinfo')}</a>
  91 + {/if}
98 </div> 92 </div>
99 <table id="table" class="table table-striped table-bordered table-hover" width="100%"> 93 <table id="table" class="table table-striped table-bordered table-hover" width="100%">
100 94
@@ -135,7 +129,7 @@ @@ -135,7 +129,7 @@
135 <div class="form-group"> 129 <div class="form-group">
136 <label class="control-label">{:__('Version')}</label> 130 <label class="control-label">{:__('Version')}</label>
137 <input type="hidden" class="operate" data-name="faversion" value="="/> 131 <input type="hidden" class="operate" data-name="faversion" value="="/>
138 - <input class="form-control" name="faversion" type="text" value="{$config.fastadmin.version}"> 132 + <input class="form-control" name="faversion" type="text" value="{$Think.config.fastadmin.version}">
139 </div> 133 </div>
140 </div> 134 </div>
141 <div class="col-xs-12 col-sm-6 col-md-3"> 135 <div class="col-xs-12 col-sm-6 col-md-3">
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 {volist name="row" id="vo" } 9 {volist name="row" id="vo" }
10 <tr> 10 <tr>
11 <td>{:__($key)}</td> 11 <td>{:__($key)}</td>
12 - <td>{$vo|htmlentities}</td> 12 + <td>{if $key=='createtime'}{$vo|datetime}{else/}{$vo|htmlentities}{/if}</td>
13 </tr> 13 </tr>
14 {/volist} 14 {/volist}
15 </tbody> 15 </tbody>
@@ -19,4 +19,4 @@ @@ -19,4 +19,4 @@
19 <div class="col-xs-12 col-sm-8"> 19 <div class="col-xs-12 col-sm-8">
20 <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button> 20 <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button>
21 </div> 21 </div>
22 -</div>  
  22 +</div>
@@ -28,13 +28,6 @@ @@ -28,13 +28,6 @@
28 <a href="__PUBLIC__" target="_blank"><i class="fa fa-home" style="font-size:14px;"></i></a> 28 <a href="__PUBLIC__" target="_blank"><i class="fa fa-home" style="font-size:14px;"></i></a>
29 </li> 29 </li>
30 30
31 - <!-- 账号信息下拉框 -->  
32 - <li class="hidden-xs">  
33 - <a href="javascript:;" data-toggle="checkupdate" title="{:__('Check for updates')}">  
34 - <i class="fa fa-refresh"></i>  
35 - </a>  
36 - </li>  
37 -  
38 <!-- 清除缓存 --> 31 <!-- 清除缓存 -->
39 <li> 32 <li>
40 <a href="javascript:;" data-toggle="dropdown" title="{:__('Wipe cache')}"> 33 <a href="javascript:;" data-toggle="dropdown" title="{:__('Wipe cache')}">
@@ -85,20 +78,6 @@ @@ -85,20 +78,6 @@
85 <small>{$admin.logintime|date="Y-m-d H:i:s",###}</small> 78 <small>{$admin.logintime|date="Y-m-d H:i:s",###}</small>
86 </p> 79 </p>
87 </li> 80 </li>
88 - <!-- Menu Body -->  
89 - <li class="user-body">  
90 - <div class="row">  
91 - <div class="col-xs-4 text-center">  
92 - <a href="https://www.fastadmin.net" target="_blank">{:__('FastAdmin')}</a>  
93 - </div>  
94 - <div class="col-xs-4 text-center">  
95 - <a href="https://forum.fastadmin.net" target="_blank">{:__('Forum')}</a>  
96 - </div>  
97 - <div class="col-xs-4 text-center">  
98 - <a href="https://doc.fastadmin.net" target="_blank">{:__('Docs')}</a>  
99 - </div>  
100 - </div>  
101 - </li>  
102 <!-- Menu Footer--> 81 <!-- Menu Footer-->
103 <li class="user-footer"> 82 <li class="user-footer">
104 <div class="pull-left"> 83 <div class="pull-left">
@@ -120,7 +99,7 @@ @@ -120,7 +99,7 @@
120 </div> 99 </div>
121 </div> 100 </div>
122 101
123 - {if $config.fastadmin.multiplenav} 102 + {if $Think.config.fastadmin.multiplenav}
124 <!--第二级菜单,只有在multiplenav开启时才显示--> 103 <!--第二级菜单,只有在multiplenav开启时才显示-->
125 <div id="secondnav"> 104 <div id="secondnav">
126 <ul class="nav nav-tabs nav-addtabs disable-top-badge" role="tablist"> 105 <ul class="nav nav-tabs nav-addtabs disable-top-badge" role="tablist">
@@ -30,15 +30,10 @@ @@ -30,15 +30,10 @@
30 </div> 30 </div>
31 31
32 <!--如果想始终显示子菜单,则给ul加上show-submenu类即可,当multiplenav开启的情况下默认为展开--> 32 <!--如果想始终显示子菜单,则给ul加上show-submenu类即可,当multiplenav开启的情况下默认为展开-->
33 - <ul class="sidebar-menu {if $config.fastadmin.multiplenav}show-submenu{/if}"> 33 + <ul class="sidebar-menu {if $Think.config.fastadmin.multiplenav}show-submenu{/if}">
34 34
35 <!-- 菜单可以在 后台管理->权限管理->菜单规则 中进行增删改排序 --> 35 <!-- 菜单可以在 后台管理->权限管理->菜单规则 中进行增删改排序 -->
36 {$menulist} 36 {$menulist}
37 37
38 - <!--以下4行可以删除或改成自己的链接,但建议你在你的网站上添加一个FastAdmin的链接-->  
39 - <li class="header" data-rel="external">{:__('Links')}</li>  
40 - <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>  
41 - <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>  
42 - <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>  
43 </ul> 38 </ul>
44 </section> 39 </section>
@@ -150,11 +150,6 @@ @@ -150,11 +150,6 @@
150 padding: 30px 0; 150 padding: 30px 0;
151 } 151 }
152 </style> 152 </style>
153 -{if preg_match('/\/admin\/|admin\.php|admin_d75KABNWt\.php/i', url())}  
154 -<div class="alert alert-danger-light">  
155 - {:__('Security tips')}  
156 -</div>  
157 -{/if}  
158 <div class="panel panel-default panel-intro"> 153 <div class="panel panel-default panel-intro">
159 <div class="panel-heading"> 154 <div class="panel-heading">
160 {:build_heading(null, false)} 155 {:build_heading(null, false)}
@@ -370,123 +365,6 @@ @@ -370,123 +365,6 @@
370 </div> 365 </div>
371 </div> 366 </div>
372 </div> 367 </div>
373 -  
374 - <div class="row">  
375 - <div class="col-lg-4">  
376 - <div class="box box-danger">  
377 - <div class="box-header with-border">  
378 - <h3 class="box-title">{:__('Recent news')}</h3>  
379 -  
380 - <div class="box-tools pull-right">  
381 - </div>  
382 - </div>  
383 - <div class="box-body">  
384 - <ul class="products-list product-list-in-box">  
385 - {for start="1" end="8"}  
386 - <li class="item">  
387 - <div class="product-img">  
388 - <img src="__CDN__/assets/img/avatar.png" style="height:40px;width:40px;">  
389 - </div>  
390 - <div class="product-info">  
391 - <a href="https://www.fastadmin.net" target="_blank" class="product-title">  
392 - FastAdmin  
393 - <span class="label label-{:$i%3===0?'warning':($i%2===0?'success':'info')} pull-right">开源免费</span>  
394 - </a>  
395 - <span class="product-description">  
396 - 一款基于ThinkPHP5+Bootstrap的极速后台开发框架  
397 - </span>  
398 - </div>  
399 - </li>  
400 - {/for}  
401 - </ul>  
402 - </div>  
403 - </div>  
404 - </div>  
405 - <div class="col-lg-4">  
406 - <div class="box box-success">  
407 - <div class="box-header with-border">  
408 - <h3 class="box-title">{:__('Recent discussion')}</h3>  
409 -  
410 - <div class="box-tools pull-right">  
411 - </div>  
412 - </div>  
413 - <div class="box-body">  
414 - <ul class="nav nav-pills nav-stacked">  
415 - <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>  
416 - <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>  
417 - <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>  
418 - <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>  
419 - <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>  
420 - <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>  
421 - <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>  
422 - <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>  
423 - <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>  
424 - <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>  
425 - <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>  
426 - </ul>  
427 - </div>  
428 - </div>  
429 - </div>  
430 - <div class="col-lg-4">  
431 - <div class="box box-info">  
432 - <div class="box-header"><h3 class="box-title">{:__('Server info')}</h3></div>  
433 - <div class="box-body" style="padding-top:0;">  
434 - <table class="table table-striped">  
435 - <tbody>  
436 - <tr>  
437 - <td width="140">{:__('FastAdmin version')}</td>  
438 - <td>{$Think.config.fastadmin.version} <a href="javascript:;" class="btn btn-xs btn-checkversion">检查最新版</a></td>  
439 - </tr>  
440 - <tr>  
441 - <td>{:__('FastAdmin addon version')}</td>  
442 - <td>{$addonversion}</td>  
443 - </tr>  
444 - <tr>  
445 - <td>{:__('Thinkphp version')}</td>  
446 - <td>{:THINK_VERSION}</td>  
447 - </tr>  
448 - <tr>  
449 - <td>{:__('Sapi name')}</td>  
450 - <td>{:php_sapi_name()}</td>  
451 - </tr>  
452 - <tr>  
453 - <td>{:__('Debug mode')}</td>  
454 - <td>{$Think.config.app_debug?__('Yes'):__('No')}</td>  
455 - </tr>  
456 - <tr>  
457 - <td>{:__('Software')}</td>  
458 - <td>{$Think.server.SERVER_SOFTWARE}</td>  
459 - </tr>  
460 - <tr>  
461 - <td>{:__('Upload mode')}</td>  
462 - <td>{$uploadmode}</td>  
463 - </tr>  
464 - <tr>  
465 - <td>{:__('Upload url')}</td>  
466 - <td>{$config.upload.uploadurl}</td>  
467 - </tr>  
468 - <tr>  
469 - <td>{:__('Upload Cdn url')}</td>  
470 - <td>{$config.upload.cdnurl}</td>  
471 - </tr>  
472 - <tr>  
473 - <td>{:__('Timezone')}</td>  
474 - <td>{:date_default_timezone_get()}</td>  
475 - </tr>  
476 - <tr>  
477 - <td>{:__('Cdn url')}</td>  
478 - <td>__CDN__</td>  
479 - </tr>  
480 - <tr>  
481 - <td>{:__('Language')}</td>  
482 - <td>{$config.language}</td>  
483 - </tr>  
484 - </tbody>  
485 - </table>  
486 - </div>  
487 - </div>  
488 - </div>  
489 - </div>  
490 </div> 368 </div>
491 <div class="tab-pane fade" id="two"> 369 <div class="tab-pane fade" id="two">
492 <div class="row"> 370 <div class="row">
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <div class="form-group"> 3 <div class="form-group">
4 <label for="c-url" class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label> 4 <label for="c-url" class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
5 <div class="col-xs-12 col-sm-8"> 5 <div class="col-xs-12 col-sm-8">
6 - <input type="text" name="row[url]" value="{$row.url}" id="c-url" class="form-control" required /> 6 + <input type="text" name="row[url]" value="{$row.url|htmlentities}" id="c-url" class="form-control" required />
7 </div> 7 </div>
8 </div> 8 </div>
9 <div class="form-group"> 9 <div class="form-group">
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 <div class="form-group"> 21 <div class="form-group">
22 <label for="c-imagetype" class="control-label col-xs-12 col-sm-2">{:__('Imagetype')}:</label> 22 <label for="c-imagetype" class="control-label col-xs-12 col-sm-2">{:__('Imagetype')}:</label>
23 <div class="col-xs-12 col-sm-8"> 23 <div class="col-xs-12 col-sm-8">
24 - <input type="text" name="row[imagetype]" value="{$row.imagetype}" id="c-imagetype" class="form-control" required /> 24 + <input type="text" name="row[imagetype]" value="{$row.imagetype|htmlentities}" id="c-imagetype" class="form-control" required />
25 </div> 25 </div>
26 </div> 26 </div>
27 <div class="form-group"> 27 <div class="form-group">
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 <div class="form-group"> 39 <div class="form-group">
40 <label for="c-mimetype" class="control-label col-xs-12 col-sm-2">{:__('Mimetype')}:</label> 40 <label for="c-mimetype" class="control-label col-xs-12 col-sm-2">{:__('Mimetype')}:</label>
41 <div class="col-xs-12 col-sm-8"> 41 <div class="col-xs-12 col-sm-8">
42 - <input type="text" name="row[mimetype]" value="{$row.mimetype}" id="c-mimetype" class="form-control" /> 42 + <input type="text" name="row[mimetype]" value="{$row.mimetype|htmlentities}" id="c-mimetype" class="form-control" />
43 </div> 43 </div>
44 </div> 44 </div>
45 <div class="form-group"> 45 <div class="form-group">
1 <div class="panel panel-default panel-intro"> 1 <div class="panel panel-default panel-intro">
2 - {:build_heading()} 2 +
  3 + <div class="panel-heading">
  4 + {:build_heading(null,FALSE)}
  5 + <ul class="nav nav-tabs" data-field="mimetype">
  6 + <li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
  7 + {foreach name="mimetypeList" item="vo"}
  8 + <li><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
  9 + {/foreach}
  10 + </ul>
  11 + </div>
3 12
4 <div class="panel-body"> 13 <div class="panel-body">
5 <div id="myTabContent" class="tab-content"> 14 <div id="myTabContent" class="tab-content">
6 <div class="tab-pane fade active in" id="one"> 15 <div class="tab-pane fade active in" id="one">
7 <div class="widget-body no-padding"> 16 <div class="widget-body no-padding">
8 <div id="toolbar" class="toolbar"> 17 <div id="toolbar" class="toolbar">
9 - {:build_toolbar()} 18 + {:build_toolbar('refresh,add,edit,del')}
10 </div> 19 </div>
11 <table id="table" class="table table-striped table-bordered table-hover" width="100%"> 20 <table id="table" class="table table-striped table-bordered table-hover" width="100%">
12 </table> 21 </table>
1 <div class="panel panel-default panel-intro"> 1 <div class="panel panel-default panel-intro">
2 - {:build_heading()} 2 + {if !$Think.get.mimetype}
  3 + <div class="panel-heading">
  4 + {:build_heading(null,FALSE)}
  5 + <ul class="nav nav-tabs" data-field="mimetype">
  6 + <li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
  7 + {foreach name="mimetypeList" item="vo"}
  8 + <li><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
  9 + {/foreach}
  10 + </ul>
  11 + </div>
  12 + {/if}
3 13
4 <div class="panel-body"> 14 <div class="panel-body">
5 <div id="myTabContent" class="tab-content"> 15 <div id="myTabContent" class="tab-content">
@@ -146,7 +146,7 @@ @@ -146,7 +146,7 @@
146 146
147 </td> 147 </td>
148 <td>{php}echo "{\$site.". $item['name'] . "}";{/php}</td> 148 <td>{php}echo "{\$site.". $item['name'] . "}";{/php}</td>
149 - <td><a href="javascript:;" class="btn-delcfg text-muted" data-name="{$item.name}"><i class="fa fa-times"></i></a></td> 149 + <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>
150 </tr> 150 </tr>
151 {/foreach} 151 {/foreach}
152 </tbody> 152 </tbody>
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <!-- 加载样式及META信息 --> 4 <!-- 加载样式及META信息 -->
5 {include file="common/meta" /} 5 {include file="common/meta" /}
6 </head> 6 </head>
7 - <body class="hold-transition skin-green sidebar-mini fixed {if $config.fastadmin.multiplenav}multiplenav{/if}" id="tabs"> 7 + <body class="hold-transition skin-green sidebar-mini fixed {if $Think.config.fastadmin.multiplenav}multiplenav{/if}" id="tabs">
8 <div class="wrapper"> 8 <div class="wrapper">
9 9
10 <!-- 头部区域 --> 10 <!-- 头部区域 -->
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 <footer class="main-footer hide"> 35 <footer class="main-footer hide">
36 <div class="pull-right hidden-xs"> 36 <div class="pull-right hidden-xs">
37 </div> 37 </div>
38 - <strong>Copyright &copy; 2017-2018 <a href="https://www.fastadmin.net">Fastadmin</a>.</strong> All rights reserved. 38 + <strong>Copyright &copy; 2017-2020 <a href="__PUBLIC__">{$site.name}</a>.</strong> All rights reserved.
39 </footer> 39 </footer>
40 40
41 <!-- 右侧控制栏 --> 41 <!-- 右侧控制栏 -->
@@ -76,7 +76,7 @@ @@ -76,7 +76,7 @@
76 <div class="input-group-addon"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span></div> 76 <div class="input-group-addon"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span></div>
77 <input type="password" class="form-control" id="pd-form-password" placeholder="{:__('Password')}" name="password" autocomplete="off" value="" data-rule="{:__('Password')}:required;password" /> 77 <input type="password" class="form-control" id="pd-form-password" placeholder="{:__('Password')}" name="password" autocomplete="off" value="" data-rule="{:__('Password')}:required;password" />
78 </div> 78 </div>
79 - {if $config.fastadmin.login_captcha} 79 + {if $Think.config.fastadmin.login_captcha}
80 <div class="input-group"> 80 <div class="input-group">
81 <div class="input-group-addon"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></div> 81 <div class="input-group-addon"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></div>
82 <input type="text" name="captcha" class="form-control" placeholder="{:__('Captcha')}" data-rule="{:__('Captcha')}:required;length(4)" /> 82 <input type="text" name="captcha" class="form-control" placeholder="{:__('Captcha')}" data-rule="{:__('Captcha')}:required;length(4)" />
@@ -97,8 +97,6 @@ @@ -97,8 +97,6 @@
97 </form> 97 </form>
98 </div> 98 </div>
99 </div> 99 </div>
100 - <!-- FastAdmin是开源程序,建议在您的网站底部保留一个FastAdmin的链接 -->  
101 - <p class="copyright"><a href="https://www.fastadmin.net">Powered By FastAdmin</a></p>  
102 </div> 100 </div>
103 </div> 101 </div>
104 </div> 102 </div>
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 <small>{:__('Control panel')}</small> 16 <small>{:__('Control panel')}</small>
17 </h1> 17 </h1>
18 </section> 18 </section>
19 - {if !IS_DIALOG && !$config.fastadmin.multiplenav} 19 + {if !IS_DIALOG && !$Think.config.fastadmin.multiplenav}
20 <!-- RIBBON --> 20 <!-- RIBBON -->
21 <div id="ribbon"> 21 <div id="ribbon">
22 <ol class="breadcrumb pull-left"> 22 <ol class="breadcrumb pull-left">
@@ -164,6 +164,7 @@ class Api @@ -164,6 +164,7 @@ class Api
164 */ 164 */
165 protected function loadlang($name) 165 protected function loadlang($name)
166 { 166 {
  167 + $name = Loader::parseName($name);
167 Lang::load(APP_PATH . $this->request->module() . '/lang/' . $this->request->langset() . '/' . str_replace('.', '/', $name) . '.php'); 168 Lang::load(APP_PATH . $this->request->module() . '/lang/' . $this->request->langset() . '/' . str_replace('.', '/', $name) . '.php');
168 } 169 }
169 170
@@ -202,7 +202,6 @@ class Backend extends Controller @@ -202,7 +202,6 @@ class Backend extends Controller
202 'jsname' => 'backend/' . str_replace('.', '/', $controllername), 202 'jsname' => 'backend/' . str_replace('.', '/', $controllername),
203 'moduleurl' => rtrim(url("/{$modulename}", '', false), '/'), 203 'moduleurl' => rtrim(url("/{$modulename}", '', false), '/'),
204 'language' => $lang, 204 'language' => $lang,
205 - 'fastadmin' => Config::get('fastadmin'),  
206 'referer' => Session::get("referer") 205 'referer' => Session::get("referer")
207 ]; 206 ];
208 $config = array_merge($config, Config::get("view_replace_str")); 207 $config = array_merge($config, Config::get("view_replace_str"));
@@ -452,7 +451,7 @@ class Backend extends Controller @@ -452,7 +451,7 @@ class Backend extends Controller
452 //如果有primaryvalue,说明当前是初始化传值 451 //如果有primaryvalue,说明当前是初始化传值
453 if ($primaryvalue !== null) { 452 if ($primaryvalue !== null) {
454 $where = [$primarykey => ['in', $primaryvalue]]; 453 $where = [$primarykey => ['in', $primaryvalue]];
455 - $pagesize = null; 454 + $pagesize = 99999;
456 } else { 455 } else {
457 $where = function ($query) use ($word, $andor, $field, $searchfield, $custom) { 456 $where = function ($query) use ($word, $andor, $field, $searchfield, $custom) {
458 $logic = $andor == 'AND' ? '&' : '|'; 457 $logic = $andor == 'AND' ? '&' : '|';
@@ -123,6 +123,7 @@ class Frontend extends Controller @@ -123,6 +123,7 @@ class Frontend extends Controller
123 */ 123 */
124 protected function loadlang($name) 124 protected function loadlang($name)
125 { 125 {
  126 + $name = Loader::parseName($name);
126 Lang::load(APP_PATH . $this->request->module() . '/lang/' . $this->request->langset() . '/' . str_replace('.', '/', $name) . '.php'); 127 Lang::load(APP_PATH . $this->request->module() . '/lang/' . $this->request->langset() . '/' . str_replace('.', '/', $name) . '.php');
127 } 128 }
128 129
@@ -21,6 +21,19 @@ class Attachment extends Model @@ -21,6 +21,19 @@ class Attachment extends Model
21 return is_numeric($value) ? $value : strtotime($value); 21 return is_numeric($value) ? $value : strtotime($value);
22 } 22 }
23 23
  24 + public static function getMimetypeList()
  25 + {
  26 + $data = [
  27 + "image/*" => "图片",
  28 + "audio/*" => "音频",
  29 + "video/*" => "视频",
  30 + "text/*" => "文档",
  31 + "application/*" => "应用",
  32 + "zip,rar,7z,tar" => "压缩包",
  33 + ];
  34 + return $data;
  35 + }
  36 +
24 protected static function init() 37 protected static function init()
25 { 38 {
26 // 如果已经上传该资源,则不再记录 39 // 如果已经上传该资源,则不再记录
@@ -45,9 +45,6 @@ @@ -45,9 +45,6 @@
45 {/if} 45 {/if}
46 </p> 46 </p>
47 </div> 47 </div>
48 -<div class="copyright">  
49 - <p>Powered by <a href="https://www.fastadmin.net/?ref=jump">FastAdmin</a></p>  
50 -</div>  
51 {if $url} 48 {if $url}
52 <script type="text/javascript"> 49 <script type="text/javascript">
53 (function () { 50 (function () {
@@ -276,7 +276,7 @@ return [ @@ -276,7 +276,7 @@ return [
276 //自动检测更新 276 //自动检测更新
277 'checkupdate' => false, 277 'checkupdate' => false,
278 //版本号 278 //版本号
279 - 'version' => '1.0.0.20191212_beta', 279 + 'version' => '1.0.0.20200228_beta',
280 //API接口地址 280 //API接口地址
281 'api_url' => 'https://api.fastadmin.net', 281 'api_url' => 'https://api.fastadmin.net',
282 ], 282 ],
@@ -34,7 +34,7 @@ return [ @@ -34,7 +34,7 @@ return [
34 // 数据库表前缀 34 // 数据库表前缀
35 'prefix' => Env::get('database.prefix', 'fa_'), 35 'prefix' => Env::get('database.prefix', 'fa_'),
36 // 数据库调试模式 36 // 数据库调试模式
37 - 'debug' => Env::get('database.debug', true), 37 + 'debug' => Env::get('database.debug', false),
38 // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) 38 // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
39 'deploy' => 0, 39 'deploy' => 0,
40 // 数据库读写是否分离 主从式有效 40 // 数据库读写是否分离 主从式有效
1 <?php 1 <?php
2 2
3 return array ( 3 return array (
4 - 'name' => 'FastAdmin', 4 + 'name' => '我的网站',
5 'beian' => '', 5 'beian' => '',
6 'cdnurl' => '', 6 'cdnurl' => '',
7 'version' => '1.0.1', 7 'version' => '1.0.1',
@@ -22,14 +22,19 @@ class Ajax extends Frontend @@ -22,14 +22,19 @@ class Ajax extends Frontend
22 public function lang() 22 public function lang()
23 { 23 {
24 header('Content-Type: application/javascript'); 24 header('Content-Type: application/javascript');
25 - $callback = $this->request->get('callback'); 25 + header("Cache-Control: public");
  26 + header("Pragma: cache");
  27 +
  28 + $offset = 30 * 60 * 60 * 24; // 缓存一个月
  29 + header("Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT");
  30 +
26 $controllername = input("controllername"); 31 $controllername = input("controllername");
27 $this->loadlang($controllername); 32 $this->loadlang($controllername);
28 //强制输出JSON Object 33 //强制输出JSON Object
29 $result = jsonp(Lang::get(), 200, [], ['json_encode_param' => JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE]); 34 $result = jsonp(Lang::get(), 200, [], ['json_encode_param' => JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE]);
30 return $result; 35 return $result;
31 } 36 }
32 - 37 +
33 /** 38 /**
34 * 上传文件 39 * 上传文件
35 */ 40 */
@@ -16,10 +16,4 @@ class Index extends Frontend @@ -16,10 +16,4 @@ class Index extends Frontend
16 return $this->view->fetch(); 16 return $this->view->fetch();
17 } 17 }
18 18
19 - public function news()  
20 - {  
21 - $newslist = [];  
22 - return jsonp(['newslist' => $newslist, 'new' => count($newslist), 'url' => 'https://www.fastadmin.net?ref=news']);  
23 - }  
24 -  
25 } 19 }
1 <?php 1 <?php
2 2
3 return [ 3 return [
4 - 'Title' => 'Title',  
5 - 'Auth tips' => 'Unlimited parent-child permission grouping, administrator can belong to multiple groups at the same time',  
6 - 'Responsive tips' => 'Based on Bootstrap and AdminLTE, mobile phones, tablets, PCs are automatically adapted',  
7 - 'Languages tips' => 'Backend and Frontend support, View and JS share the same language package',  
8 - 'Module tips' => 'RequireJS and Bower for frontend package component management,Composer for backend package component management',  
9 - 'CRUD tips' => 'One key to generate a controller, model, view and JS file, one key to generate an API document and auth rule',  
10 - 'Extension tips' => 'Installed and uninstalled directly online plug-in, supporting the command line one key operation',  
11 - 'Do not hesitate' => 'Do not hesitate',  
12 - 'Start to act' => 'Start Action', 4 +
13 ]; 5 ];
@@ -86,9 +86,7 @@ return [ @@ -86,9 +86,7 @@ return [
86 'Gitee' => '码云', 86 'Gitee' => '码云',
87 'Github' => 'Github', 87 'Github' => 'Github',
88 'QQ group' => 'QQ群', 88 'QQ group' => 'QQ群',
89 - 'Go to Dashboard' => '登录后台',  
90 - 'Go to Member center' => '会员中心',  
91 - 'Contribution' => '为FastAdmin贡献代码!', 89 + 'Member center' => '会员中心',
92 'Copyrights' => '版权所有', 90 'Copyrights' => '版权所有',
93 'Responsive' => '响应式开发', 91 'Responsive' => '响应式开发',
94 'Languages' => '多语言', 92 'Languages' => '多语言',
1 <?php 1 <?php
2 2
3 return [ 3 return [
4 - 'Title' => '标题',  
5 - 'CRUD' => '一键CRUD',  
6 - 'Auth tips' => '基于完善的Auth权限控制管理、无限父子级权限分组、可自由分配子级权限、一个管理员可同时属于多个组别',  
7 - 'Responsive tips' => '基于Bootstrap和AdminLTE进行二次开发,手机、平板、PC均自动适配,无需要担心兼容性问题',  
8 - 'Languages tips' => '不仅仅后台开发支持多语言,同时视图部分和JS部分仍然共享同一个语言包,语法相同且自动加载',  
9 - 'Module tips' => '控制器、模型、视图、JS一一对应,使用RequireJS进行JS模块化管理,采用Bower进行前端包组件管理',  
10 - 'CRUD tips' => '可使用命令行一键生成控制器、模型、视图和JS文件,一键生成API文档,一键生成回收站,一键生成后台权限节点和菜单栏',  
11 - 'Extension tips' => 'FastAdmin提供强大丰富的应用(插件)市场,可直接在线安装和卸载用户(插件),同时支持命令行一键操作',  
12 - 'Do not hesitate' => '不要犹豫',  
13 - 'Start to act' => '开始行动', 4 +
14 ]; 5 ];
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 <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> 16 <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>
17 </span> 17 </span>
18 {else/} 18 {else/}
19 - 请在后台插件管理中安装《<a href="https://www.fastadmin.net/store/wechat.html" target="_blank">微信管理插件</a> 19 + 请在后台插件管理中安装《微信管理插件
20 {/if} 20 {/if}
21 {elseif "[type]" == 'text' /} 21 {elseif "[type]" == 'text' /}
22 <input type="text" name="captcha" class="form-control input-lg" data-rule="required;length(4)" /> 22 <input type="text" name="captcha" class="form-control input-lg" data-rule="required;length(4)" />
1 <meta charset="utf-8"> 1 <meta charset="utf-8">
2 -<title>{$title|default=''} – {:__('The fastest framework based on ThinkPHP5 and Bootstrap')}</title> 2 +<title>{$title|default=''} – {$site.name}</title>
3 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> 3 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
4 <meta name="renderer" content="webkit"> 4 <meta name="renderer" content="webkit">
5 5
@@ -9,7 +9,6 @@ @@ -9,7 +9,6 @@
9 {if isset($description)} 9 {if isset($description)}
10 <meta name="description" content="{$description}"> 10 <meta name="description" content="{$description}">
11 {/if} 11 {/if}
12 -<meta name="author" content="FastAdmin">  
13 12
14 <link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" /> 13 <link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" />
15 14
1 <div class="sidenav"> 1 <div class="sidenav">
2 {:hook('user_sidenav_before')} 2 {:hook('user_sidenav_before')}
3 <ul class="list-group"> 3 <ul class="list-group">
4 - <li class="list-group-heading">{:__('User center')}</li> 4 + <li class="list-group-heading">{:__('Member center')}</li>
5 <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> 5 <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>
6 <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> 6 <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>
7 <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> 7 <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>
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 <meta name="description" content=""> 9 <meta name="description" content="">
10 <meta name="author" content=""> 10 <meta name="author" content="">
11 11
12 - <title>FastAdmin - {:__('The fastest framework based on ThinkPHP5 and Bootstrap')}</title> 12 + <title>{$site.name}</title>
13 13
14 <!-- Bootstrap Core CSS --> 14 <!-- Bootstrap Core CSS -->
15 <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> 15 <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
@@ -34,20 +34,13 @@ @@ -34,20 +34,13 @@
34 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-menu"> 34 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-menu">
35 <span class="sr-only">Toggle navigation</span><i class="fa fa-bars"></i> 35 <span class="sr-only">Toggle navigation</span><i class="fa fa-bars"></i>
36 </button> 36 </button>
37 - <a class="navbar-brand page-scroll" href="#page-top"><img src="__CDN__/assets/img/logo.png" style="width:200px;" alt=""></a> 37 + <a class="navbar-brand page-scroll" href="#page-top">{$site.name}</a>
38 </div> 38 </div>
39 39
40 <div class="collapse navbar-collapse" id="navbar-collapse-menu"> 40 <div class="collapse navbar-collapse" id="navbar-collapse-menu">
41 <ul class="nav navbar-nav navbar-right"> 41 <ul class="nav navbar-nav navbar-right">
42 - <li><a href="https://www.fastadmin.net" target="_blank">{:__('Home')}</a></li>  
43 - <li><a href="https://www.fastadmin.net/store.html" target="_blank">{:__('Store')}</a></li>  
44 - <li><a href="https://www.fastadmin.net/wxapp.html" target="_blank">{:__('Wxapp')}</a></li>  
45 - <li><a href="https://www.fastadmin.net/service.html" target="_blank">{:__('Services')}</a></li>  
46 - <li><a href="https://www.fastadmin.net/download.html" target="_blank">{:__('Download')}</a></li>  
47 - <li><a href="https://www.fastadmin.net/demo.html" target="_blank">{:__('Demo')}</a></li>  
48 - <li><a href="https://www.fastadmin.net/donate.html" target="_blank">{:__('Donation')}</a></li>  
49 - <li><a href="https://forum.fastadmin.net" target="_blank">{:__('Forum')}</a></li>  
50 - <li><a href="https://doc.fastadmin.net" target="_blank">{:__('Docs')}</a></li> 42 + <li><a href="{:url('/')}" target="_blank">{:__('Home')}</a></li>
  43 + <li><a href="{:url('index/user/index')}" target="_blank">{:__('Member center')}</a></li>
51 </ul> 44 </ul>
52 </div> 45 </div>
53 <!-- /.navbar-collapse --> 46 <!-- /.navbar-collapse -->
@@ -61,9 +54,7 @@ @@ -61,9 +54,7 @@
61 <div class="col-sm-12"> 54 <div class="col-sm-12">
62 <div class="header-content"> 55 <div class="header-content">
63 <div class="header-content-inner"> 56 <div class="header-content-inner">
64 - <h1>FastAdmin</h1>  
65 - <h3>{:__('The fastest framework based on ThinkPHP5 and Bootstrap')}</h3>  
66 - <a href="{:url('index/user/index')}" class="btn btn-outline btn-xl page-scroll">{:__('Go to Member center')}</a> 57 + <h1>{$site.name}</h1>
67 </div> 58 </div>
68 </div> 59 </div>
69 </div> 60 </div>
@@ -71,124 +62,11 @@ @@ -71,124 +62,11 @@
71 </div> 62 </div>
72 </header> 63 </header>
73 64
74 - <section id="features" class="features">  
75 - <div class="container">  
76 - <div class="row">  
77 - <div class="col-lg-12 text-center">  
78 - <div class="section-heading">  
79 - <h2>{:__('Features')}</h2>  
80 - </div>  
81 - </div>  
82 - </div>  
83 - <div class="row">  
84 - <div class="col-md-12">  
85 - <div class="container-fluid">  
86 - <div class="row">  
87 - <div class="col-md-4">  
88 - <div class="feature-item">  
89 - <i class="icon-user text-primary"></i>  
90 - <h3>{:__('Auth')}</h3>  
91 - <p class="text-muted">{:__('Auth tips')}</p>  
92 - </div>  
93 - </div>  
94 - <div class="col-md-4">  
95 - <div class="feature-item">  
96 - <i class="icon-screen-smartphone text-primary"></i>  
97 - <h3>{:__('Responsive')}</h3>  
98 - <p class="text-muted">{:__('Responsive tips')}</p>  
99 - </div>  
100 - </div>  
101 - <div class="col-md-4">  
102 - <div class="feature-item">  
103 - <i class="icon-present text-primary"></i>  
104 - <h3>{:__('Languages')}</h3>  
105 - <p class="text-muted">{:__('Languages tips')}</p>  
106 - </div>  
107 - </div>  
108 - <div class="col-md-4">  
109 - <div class="feature-item">  
110 - <i class="icon-layers text-primary"></i>  
111 - <h3>{:__('Module')}</h3>  
112 - <p class="text-muted">{:__('Module tips')}</p>  
113 - </div>  
114 - </div>  
115 - <div class="col-md-4">  
116 - <div class="feature-item">  
117 - <i class="icon-docs text-primary"></i>  
118 - <h3>{:__('CRUD')}</h3>  
119 - <p class="text-muted">{:__('CRUD tips')}</p>  
120 - </div>  
121 - </div>  
122 - <div class="col-md-4">  
123 - <div class="feature-item">  
124 - <i class="icon-puzzle text-primary"></i>  
125 - <h3>{:__('Extension')}</h3>  
126 - <p class="text-muted">{:__('Extension tips')}</p>  
127 - </div>  
128 - </div>  
129 - </div>  
130 - </div>  
131 - </div>  
132 - </div>  
133 - </div>  
134 - </section>  
135 -  
136 - <section class="cta">  
137 - <div class="cta-content">  
138 - <div class="container">  
139 - <h2>{:__('Do not hesitate')}<br>{:__('Start to act')}</h2>  
140 - <a href="https://doc.fastadmin.net/docs/contributing.html" class="btn btn-outline btn-xl page-scroll">{:__('Contribution')}</a>  
141 - </div>  
142 - </div>  
143 - <div class="overlay"></div>  
144 - </section>  
145 -  
146 - <footer>  
147 - <div class="container">  
148 - <!-- FastAdmin是开源程序,建议在您的网站底部保留一个FastAdmin的链接 -->  
149 - <p>&copy; 2017-2019 <a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>. All Rights Reserved.</p>  
150 - <ul class="list-inline">  
151 - <li>  
152 - <a href="https://gitee.com/karson/fastadmin">{:__('Gitee')}</a>  
153 - </li>  
154 - <li>  
155 - <a href="https://github.com/karsonzhang/fastadmin">{:__('Github')}</a>  
156 - </li>  
157 - <li>  
158 - <a href="https://shang.qq.com/wpa/qunwpa?idkey=46c326e570d0f97cfae1f8257ae82322192ec8841c79b2136446df0b3b62028c">{:__('QQ group')}</a>  
159 - </li>  
160 - </ul>  
161 - </div>  
162 - </footer>  
163 -  
164 <!-- jQuery --> 65 <!-- jQuery -->
165 <script src=https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js></script> 66 <script src=https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js></script>
166 67
167 <!-- Bootstrap Core JavaScript --> 68 <!-- Bootstrap Core JavaScript -->
168 <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> 69 <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
169 -  
170 - <!-- Plugin JavaScript -->  
171 - <script src="https://cdn.staticfile.org/jquery-easing/1.4.1/jquery.easing.min.js"></script>  
172 -  
173 - <script>  
174 - $(function () {  
175 - $(window).on("scroll", function () {  
176 - $("#mainNav").toggleClass("affix", $(window).height() - $(window).scrollTop() <= 50);  
177 - });  
178 - });  
179 - </script>  
180 -  
181 - <script>  
182 - // FastAdmin统计代码,请移除  
183 - var _hmt = _hmt || [];  
184 - (function () {  
185 - var hm = document.createElement("script");  
186 - hm.src = "https://hm.baidu.com/hm.js?f8d0a8c400404989e195270b0bbf060a";  
187 - var s = document.getElementsByTagName("script")[0];  
188 - s.parentNode.insertBefore(hm, s);  
189 - })();  
190 - </script>  
191 -  
192 </body> 70 </body>
193 71
194 -</html>  
  72 +</html>
@@ -16,19 +16,11 @@ @@ -16,19 +16,11 @@
16 <span class="icon-bar"></span> 16 <span class="icon-bar"></span>
17 <span class="icon-bar"></span> 17 <span class="icon-bar"></span>
18 </button> 18 </button>
19 - <a class="navbar-brand" href="{:url('/')}" style="padding:6px 15px;"><img src="__CDN__/assets/img/logo.png" style="height:40px;" alt=""></a> 19 + <a class="navbar-brand" href="{:url('/')}">{$site.name}</a>
20 </div> 20 </div>
21 <div class="collapse navbar-collapse" id="header-navbar"> 21 <div class="collapse navbar-collapse" id="header-navbar">
22 <ul class="nav navbar-nav navbar-right"> 22 <ul class="nav navbar-nav navbar-right">
23 - <li><a href="https://www.fastadmin.net" target="_blank">{:__('Home')}</a></li>  
24 - <li><a href="https://www.fastadmin.net/store.html" target="_blank">{:__('Store')}</a></li>  
25 - <li><a href="https://www.fastadmin.net/wxapp.html" target="_blank">{:__('Wxapp')}</a></li>  
26 - <li><a href="https://www.fastadmin.net/service.html" target="_blank">{:__('Services')}</a></li>  
27 - <li><a href="https://www.fastadmin.net/download.html" target="_blank">{:__('Download')}</a></li>  
28 - <li><a href="https://www.fastadmin.net/demo.html" target="_blank">{:__('Demo')}</a></li>  
29 - <li><a href="https://www.fastadmin.net/donate.html" target="_blank">{:__('Donation')}</a></li>  
30 - <li><a href="https://forum.fastadmin.net" target="_blank">{:__('Forum')}</a></li>  
31 - <li><a href="https://doc.fastadmin.net" target="_blank">{:__('Docs')}</a></li> 23 + <li><a href="{:url('/')}" target="_blank">{:__('Home')}</a></li>
32 <li class="dropdown"> 24 <li class="dropdown">
33 {if $user} 25 {if $user}
34 <a href="{:url('user/index')}" class="dropdown-toggle" data-toggle="dropdown" style="padding-top: 10px;height: 50px;"> 26 <a href="{:url('user/index')}" class="dropdown-toggle" data-toggle="dropdown" style="padding-top: 10px;height: 50px;">
@@ -60,8 +52,7 @@ @@ -60,8 +52,7 @@
60 </main> 52 </main>
61 53
62 <footer class="footer" style="clear:both"> 54 <footer class="footer" style="clear:both">
63 - <!-- FastAdmin是开源程序,建议在您的网站底部保留一个FastAdmin的链接 -->  
64 - <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> 55 + <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>
65 </footer> 56 </footer>
66 57
67 {include file="common/script" /} 58 {include file="common/script" /}
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <div class="panel panel-default "> 20 <div class="panel panel-default ">
21 <div class="panel-body"> 21 <div class="panel-body">
22 <h2 class="page-header"> 22 <h2 class="page-header">
23 - {:__('User center')} 23 + {:__('Member center')}
24 <a href="{:url('user/profile')}" class="btn btn-success pull-right"><i class="fa fa-pencil"></i> 24 <a href="{:url('user/profile')}" class="btn btn-success pull-right"><i class="fa fa-pencil"></i>
25 {:__('Profile')}</a> 25 {:__('Profile')}</a>
26 </h2> 26 </h2>
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 // 定义应用目录 15 // 定义应用目录
16 define('APP_PATH', __DIR__ . '/../application/'); 16 define('APP_PATH', __DIR__ . '/../application/');
17 17
18 -// 判断是否安装FastAdmin 18 +// 判断是否安装
19 if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) 19 if (!is_file(APP_PATH . 'admin/command/Install/install.lock'))
20 { 20 {
21 header("location:./install.php"); 21 header("location:./install.php");
@@ -5,8 +5,7 @@ @@ -5,8 +5,7 @@
5 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6 <meta name="viewport" content="width=device-width, initial-scale=1.0">
7 <meta name="description" content=""> 7 <meta name="description" content="">
8 - <meta name="author" content="FastAdmin">  
9 - <title>FastAdmin</title> 8 + <title>我的网站</title>
10 9
11 <!-- Bootstrap Core CSS --> 10 <!-- Bootstrap Core CSS -->
12 <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> 11 <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
@@ -109,7 +108,7 @@ @@ -109,7 +108,7 @@
109 <span class="icon-bar"></span> 108 <span class="icon-bar"></span>
110 <span class="icon-bar"></span> 109 <span class="icon-bar"></span>
111 </button> 110 </button>
112 - <a class="navbar-brand" href="https://www.fastadmin.net" target="_blank">FastAdmin</a> 111 + <a class="navbar-brand" href="./" target="_blank">我的网站</a>
113 </div> 112 </div>
114 <div class="navbar-collapse collapse"> 113 <div class="navbar-collapse collapse">
115 <form class="navbar-form navbar-right"> 114 <form class="navbar-form navbar-right">
@@ -2086,6 +2085,12 @@ @@ -2086,6 +2085,12 @@
2086 <td></td> 2085 <td></td>
2087 <td>手机号</td> 2086 <td>手机号</td>
2088 </tr> 2087 </tr>
  2088 + <tr>
  2089 + <td>code</td>
  2090 + <td>string</td>
  2091 + <td></td>
  2092 + <td>验证码</td>
  2093 + </tr>
2089 </tbody> 2094 </tbody>
2090 </table> 2095 </table>
2091 </div> 2096 </div>
@@ -2121,6 +2126,10 @@ @@ -2121,6 +2126,10 @@
2121 <input type="string" class="form-control input-sm" id="mobile" required placeholder="手机号" name="mobile"> 2126 <input type="string" class="form-control input-sm" id="mobile" required placeholder="手机号" name="mobile">
2122 </div> 2127 </div>
2123 <div class="form-group"> 2128 <div class="form-group">
  2129 + <label class="control-label" for="code">code</label>
  2130 + <input type="string" class="form-control input-sm" id="code" required placeholder="验证码" name="code">
  2131 + </div>
  2132 + <div class="form-group">
2124 <button type="submit" class="btn btn-success send" rel="16">提交</button> 2133 <button type="submit" class="btn btn-success send" rel="16">提交</button>
2125 <button type="reset" class="btn btn-info" rel="16">重置</button> 2134 <button type="reset" class="btn btn-info" rel="16">重置</button>
2126 </div> 2135 </div>
@@ -2555,7 +2564,7 @@ @@ -2555,7 +2564,7 @@
2555 </thead> 2564 </thead>
2556 <tbody> 2565 <tbody>
2557 <tr> 2566 <tr>
2558 - <td>email</td> 2567 + <td>mobile</td>
2559 <td>string</td> 2568 <td>string</td>
2560 <td></td> 2569 <td></td>
2561 <td>手机号</td> 2570 <td>手机号</td>
@@ -2585,8 +2594,8 @@ @@ -2585,8 +2594,8 @@
2585 <div class="panel-body"> 2594 <div class="panel-body">
2586 <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/changemobile" method="get" name="form20" id="form20"> 2595 <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/changemobile" method="get" name="form20" id="form20">
2587 <div class="form-group"> 2596 <div class="form-group">
2588 - <label class="control-label" for="email">email</label>  
2589 - <input type="string" class="form-control input-sm" id="email" required placeholder="手机号" name="email"> 2597 + <label class="control-label" for="mobile">mobile</label>
  2598 + <input type="string" class="form-control input-sm" id="mobile" required placeholder="手机号" name="mobile">
2590 </div> 2599 </div>
2591 <div class="form-group"> 2600 <div class="form-group">
2592 <label class="control-label" for="captcha">captcha</label> 2601 <label class="control-label" for="captcha">captcha</label>
@@ -3730,9 +3739,9 @@ @@ -3730,9 +3739,9 @@
3730 3739
3731 <div class="row mt0 footer"> 3740 <div class="row mt0 footer">
3732 <div class="col-md-6" align="left"> 3741 <div class="col-md-6" align="left">
3733 - Generated on 2019-06-28 12:14:48 </div> 3742 + Generated on 2020-02-16 16:01:35 </div>
3734 <div class="col-md-6" align="right"> 3743 <div class="col-md-6" align="right">
3735 - <a href="https://www.fastadmin.net" target="_blank">FastAdmin</a> 3744 + <a href="./" target="_blank">我的网站</a>
3736 </div> 3745 </div>
3737 </div> 3746 </div>
3738 3747
@@ -43,11 +43,6 @@ p { @@ -43,11 +43,6 @@ p {
43 margin-bottom: 20px; 43 margin-bottom: 20px;
44 } 44 }
45 .navbar-default { 45 .navbar-default {
46 - background-color: white;  
47 - border-color: rgba(34, 34, 34, 0.05);  
48 - -webkit-transition: all 0.35s;  
49 - -moz-transition: all 0.35s;  
50 - transition: all 0.35s;  
51 font-family: 'Catamaran', 'Helvetica', 'Arial', 'sans-serif'; 46 font-family: 'Catamaran', 'Helvetica', 'Arial', 'sans-serif';
52 font-weight: 200; 47 font-weight: 200;
53 letter-spacing: 1px; 48 letter-spacing: 1px;
@@ -56,7 +51,6 @@ p { @@ -56,7 +51,6 @@ p {
56 font-family: 'Catamaran', 'Helvetica', 'Arial', 'sans-serif'; 51 font-family: 'Catamaran', 'Helvetica', 'Arial', 'sans-serif';
57 font-weight: 200; 52 font-weight: 200;
58 letter-spacing: 1px; 53 letter-spacing: 1px;
59 - color: #fdcc52;  
60 } 54 }
61 .navbar-default .navbar-header .navbar-brand:hover, 55 .navbar-default .navbar-header .navbar-brand:hover,
62 .navbar-default .navbar-header .navbar-brand:focus { 56 .navbar-default .navbar-header .navbar-brand:focus {
@@ -72,10 +66,6 @@ p { @@ -72,10 +66,6 @@ p {
72 letter-spacing: 2px; 66 letter-spacing: 2px;
73 font-size: 14px; 67 font-size: 14px;
74 } 68 }
75 -.navbar-default .nav > li > a,  
76 -.navbar-default .nav > li > a:focus {  
77 - color: #222222;  
78 -}  
79 .navbar-default .nav > li > a:hover, 69 .navbar-default .nav > li > a:hover,
80 .navbar-default .nav > li > a:focus:hover { 70 .navbar-default .nav > li > a:focus:hover {
81 color: #fdcc52; 71 color: #fdcc52;
@@ -89,9 +79,6 @@ p { @@ -89,9 +79,6 @@ p {
89 .navbar-default .nav > li.active > a:focus:hover { 79 .navbar-default .nav > li.active > a:focus:hover {
90 background-color: transparent; 80 background-color: transparent;
91 } 81 }
92 -.navbar-default .navbar-header .navbar-brand {  
93 - padding-top:3px;  
94 -}  
95 @media (min-width: 768px) { 82 @media (min-width: 768px) {
96 .navbar-default { 83 .navbar-default {
97 background-color: transparent; 84 background-color: transparent;
@@ -112,36 +99,17 @@ p { @@ -112,36 +99,17 @@ p {
112 .navbar-default .nav > li > a:focus:hover { 99 .navbar-default .nav > li > a:focus:hover {
113 color: white; 100 color: white;
114 } 101 }
115 - .navbar-default.affix {  
116 - background-color: white;  
117 - border-color: rgba(34, 34, 34, 0.1);  
118 - }  
119 - .navbar-default.affix .navbar-header .navbar-brand {  
120 - color: #222222;  
121 - }  
122 - .navbar-default.affix .navbar-header .navbar-brand:hover,  
123 - .navbar-default.affix .navbar-header .navbar-brand:focus {  
124 - color: #fdcc52;  
125 - }  
126 - .navbar-default.affix .nav > li > a,  
127 - .navbar-default.affix .nav > li > a:focus {  
128 - color: #222222;  
129 - }  
130 - .navbar-default.affix .nav > li > a:hover,  
131 - .navbar-default.affix .nav > li > a:focus:hover {  
132 - color: #fdcc52;  
133 - }  
134 } 102 }
135 header { 103 header {
136 position: relative; 104 position: relative;
137 width: 100%; 105 width: 100%;
138 min-height: auto; 106 min-height: auto;
139 overflow-y: hidden; 107 overflow-y: hidden;
140 - background: url("../img/bg-pattern.png"), #7b4397; 108 + background: url("../img/bg-pattern.png"), #247cdc;
141 /* fallback for old browsers */ 109 /* fallback for old browsers */
142 background: url("../img/bg-pattern.png"), -webkit-linear-gradient(to left, #328944, #247cdc); 110 background: url("../img/bg-pattern.png"), -webkit-linear-gradient(to left, #328944, #247cdc);
143 /* Chrome 10-25, Safari 5.1-6 */ 111 /* Chrome 10-25, Safari 5.1-6 */
144 - background: url(../img/bg-pattern.png), linear-gradient(to left, #328944, #247cdc); 112 + background: url("../img/bg-pattern.png"), linear-gradient(to left, #328944, #247cdc);
145 /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */ 113 /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
146 color: white; 114 color: white;
147 } 115 }
@@ -215,153 +183,6 @@ section { @@ -215,153 +183,6 @@ section {
215 section h2 { 183 section h2 {
216 font-size: 50px; 184 font-size: 50px;
217 } 185 }
218 -section.download {  
219 - padding: 150px 0;  
220 - position: relative;  
221 -}  
222 -section.download h2 {  
223 - margin-top: 0;  
224 - font-size: 50px;  
225 -}  
226 -section.download .badges .badge-link {  
227 - display: block;  
228 - margin-bottom: 25px;  
229 -}  
230 -section.download .badges .badge-link:last-child {  
231 - margin-bottom: 0;  
232 -}  
233 -section.download .badges .badge-link img {  
234 - height: 60px;  
235 -}  
236 -@media (min-width: 768px) {  
237 - section.download .badges .badge-link {  
238 - display: inline-block;  
239 - margin-bottom: 0;  
240 - }  
241 -}  
242 -@media (min-width: 768px) {  
243 - section.download h2 {  
244 - font-size: 70px;  
245 - }  
246 -}  
247 -section.features .section-heading {  
248 - margin-bottom: 100px;  
249 -}  
250 -section.features .section-heading h2 {  
251 - margin-top: 0;  
252 -}  
253 -section.features .section-heading p {  
254 - margin-bottom: 0;  
255 -}  
256 -section.features .device-container,  
257 -section.features .feature-item {  
258 - max-width: 300px;  
259 - margin: 0 auto;  
260 - height:215px;  
261 -}  
262 -section.features .device-container {  
263 - margin-bottom: 100px;  
264 -}  
265 -@media (min-width: 992px) {  
266 - section.features .device-container {  
267 - margin-bottom: 0;  
268 - }  
269 -}  
270 -section.features .feature-item {  
271 - text-align: center;  
272 - margin-bottom: 80px;  
273 -}  
274 -section.features .feature-item h3 {  
275 - font-size: 24px;  
276 -}  
277 -section.features .feature-item i {  
278 - font-size: 60px;  
279 -  
280 - background: -webkit-linear-gradient(to left,#328944, #247cdc);  
281 - background: linear-gradient(to left, #328944, #247cdc);  
282 - -webkit-background-clip: text;  
283 - -webkit-text-fill-color: transparent;  
284 -}  
285 -@media (min-width: 992px) {  
286 - section.features .device-container,  
287 - section.features .feature-item {  
288 - max-width: none;  
289 - }  
290 -}  
291 -section.cta {  
292 - position: relative;  
293 - -webkit-background-size: cover;  
294 - -moz-background-size: cover;  
295 - background-size: cover;  
296 - -o-background-size: cover;  
297 - background-position: center;  
298 - background-image: url('../img/bg-middle.jpg');  
299 - padding: 250px 0;  
300 -}  
301 -section.cta .cta-content {  
302 - position: relative;  
303 - z-index: 1;  
304 -}  
305 -section.cta .cta-content h2 {  
306 - margin-top: 0;  
307 - margin-bottom: 25px;  
308 - color: white;  
309 - max-width: 450px;  
310 - font-size: 50px;  
311 -}  
312 -@media (min-width: 768px) {  
313 - section.cta .cta-content h2 {  
314 - font-size: 70px;  
315 - }  
316 -}  
317 -section.cta .overlay {  
318 - height: 100%;  
319 - width: 100%;  
320 - background-color: rgba(0, 0, 0, 0.5);  
321 - position: absolute;  
322 - top: 0;  
323 - left: 0;  
324 -}  
325 -section.contact {  
326 - text-align: center;  
327 -}  
328 -section.contact h2 {  
329 - margin-top: 0;  
330 - margin-bottom: 25px;  
331 -}  
332 -section.contact h2 i {  
333 - color: #dd4b39;  
334 -}  
335 -section.contact ul.list-social {  
336 - margin-bottom: 0;  
337 -}  
338 -section.contact ul.list-social li a {  
339 - display: block;  
340 - height: 80px;  
341 - width: 80px;  
342 - line-height: 80px;  
343 - font-size: 40px;  
344 - border-radius: 100%;  
345 - color: white;  
346 -}  
347 -section.contact ul.list-social li.social-github a {  
348 - background-color: #444;  
349 -}  
350 -section.contact ul.list-social li.social-github a:hover {  
351 - background-color: #111;  
352 -}  
353 -section.contact ul.list-social li.social-qq a {  
354 - background-color: #1da1f2;  
355 -}  
356 -section.contact ul.list-social li.social-qq a:hover {  
357 - background-color: #0d95e8;  
358 -}  
359 -section.contact ul.list-social li.social-weibo a {  
360 - background-color: #dd4b39;  
361 -}  
362 -section.contact ul.list-social li.social-weibo a:hover {  
363 - background-color: #d73925;  
364 -}  
365 footer { 186 footer {
366 background-color: #222222; 187 background-color: #222222;
367 padding: 25px 0; 188 padding: 25px 0;
@@ -420,6 +241,3 @@ footer ul li a.active { @@ -420,6 +241,3 @@ footer ul li a.active {
420 padding: 10px 45px; 241 padding: 10px 45px;
421 font-size: 14px; 242 font-size: 14px;
422 } 243 }
423 -body {  
424 - webkit-tap-highlight-color: #222222;  
425 -}  

22.6 KB | 宽: | 高:

20.5 KB | 宽: | 高:

  • 两方对比
  • 交换覆盖
  • 透明覆盖
不能预览此文件类型
@@ -4,7 +4,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function @@ -4,7 +4,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
4 // 初始化表格参数配置 4 // 初始化表格参数配置
5 Table.api.init({ 5 Table.api.init({
6 extend: { 6 extend: {
7 - index_url: Config.fastadmin.api_url + '/addon/index', 7 + index_url: Config.api_url ? Config.api_url + '/addon/index' : "addon/downloaded",
8 add_url: '', 8 add_url: '',
9 edit_url: '', 9 edit_url: '',
10 del_url: '', 10 del_url: '',
@@ -67,7 +67,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function @@ -67,7 +67,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
67 $.extend(params, { 67 $.extend(params, {
68 uid: userinfo ? userinfo.id : '', 68 uid: userinfo ? userinfo.id : '',
69 token: userinfo ? userinfo.token : '', 69 token: userinfo ? userinfo.token : '',
70 - version: Config.fastadmin.version 70 + version: Config.faversion
71 }); 71 });
72 return params; 72 return params;
73 }, 73 },
@@ -183,7 +183,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function @@ -183,7 +183,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
183 $(".btn-switch").removeClass("active"); 183 $(".btn-switch").removeClass("active");
184 $(this).addClass("active"); 184 $(this).addClass("active");
185 $("form.form-commonsearch input[name='type']").val($(this).data("type")); 185 $("form.form-commonsearch input[name='type']").val($(this).data("type"));
186 - table.bootstrapTable('refresh', {url: $(this).data("url"), pageNumber: 1}); 186 + table.bootstrapTable('refresh', {url: ($(this).data("url") ? $(this).data("url") : $.fn.bootstrapTable.defaults.extend.index_url), pageNumber: 1});
187 return false; 187 return false;
188 }); 188 });
189 $(document).on("click", ".nav-category li a", function () { 189 $(document).on("click", ".nav-category li a", function () {
@@ -208,7 +208,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function @@ -208,7 +208,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
208 btn: [__('Login'), __('Register')], 208 btn: [__('Login'), __('Register')],
209 yes: function (index, layero) { 209 yes: function (index, layero) {
210 Fast.api.ajax({ 210 Fast.api.ajax({
211 - url: Config.fastadmin.api_url + '/user/login', 211 + url: Config.api_url + '/user/login',
212 dataType: 'jsonp', 212 dataType: 'jsonp',
213 data: { 213 data: {
214 account: $("#inputAccount", layero).val(), 214 account: $("#inputAccount", layero).val(),
@@ -231,7 +231,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function @@ -231,7 +231,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
231 }); 231 });
232 } else { 232 } else {
233 Fast.api.ajax({ 233 Fast.api.ajax({
234 - url: Config.fastadmin.api_url + '/user/index', 234 + url: Config.api_url + '/user/index',
235 dataType: 'jsonp', 235 dataType: 'jsonp',
236 data: { 236 data: {
237 user_id: userinfo.id, 237 user_id: userinfo.id,
@@ -246,7 +246,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function @@ -246,7 +246,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
246 btn: [__('Logout'), __('Cancel')], 246 btn: [__('Logout'), __('Cancel')],
247 yes: function () { 247 yes: function () {
248 Fast.api.ajax({ 248 Fast.api.ajax({
249 - url: Config.fastadmin.api_url + '/user/logout', 249 + url: Config.api_url + '/user/logout',
250 dataType: 'jsonp', 250 dataType: 'jsonp',
251 data: {uid: userinfo.id, token: userinfo.token} 251 data: {uid: userinfo.id, token: userinfo.token}
252 }, function (data, ret) { 252 }, function (data, ret) {
@@ -282,7 +282,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function @@ -282,7 +282,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
282 uid: uid, 282 uid: uid,
283 token: token, 283 token: token,
284 version: version, 284 version: version,
285 - faversion: Config.fastadmin.version 285 + faversion: Config.faversion
286 } 286 }
287 }, function (data, ret) { 287 }, function (data, ret) {
288 Layer.closeAll(); 288 Layer.closeAll();
@@ -420,7 +420,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function @@ -420,7 +420,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
420 var token = userinfo ? userinfo.token : ''; 420 var token = userinfo ? userinfo.token : '';
421 Fast.api.ajax({ 421 Fast.api.ajax({
422 url: 'addon/upgrade', 422 url: 'addon/upgrade',
423 - data: {name: name, uid: uid, token: token, version: version, faversion: Config.fastadmin.version} 423 + data: {name: name, uid: uid, token: token, version: version, faversion: Config.faversion}
424 }, function (data, ret) { 424 }, function (data, ret) {
425 Config['addons'][name].version = version; 425 Config['addons'][name].version = version;
426 Layer.closeAll(); 426 Layer.closeAll();
@@ -560,7 +560,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function @@ -560,7 +560,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
560 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; 560 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;
561 }, 561 },
562 home: function (value, row, index) { 562 home: function (value, row, index) {
563 - 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>'; 563 + 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>';
564 }, 564 },
565 }, 565 },
566 bindevent: function () { 566 bindevent: function () {
@@ -24,7 +24,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -24,7 +24,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
24 {field: 'id', title: 'ID', operate: false}, 24 {field: 'id', title: 'ID', operate: false},
25 {field: 'username', title: __('Username'), formatter: Table.api.formatter.search}, 25 {field: 'username', title: __('Username'), formatter: Table.api.formatter.search},
26 {field: 'title', title: __('Title'), operate: 'LIKE %...%', placeholder: '模糊搜索'}, 26 {field: 'title', title: __('Title'), operate: 'LIKE %...%', placeholder: '模糊搜索'},
27 - {field: 'url', title: __('Url'), align: 'left', formatter: Table.api.formatter.url}, 27 + {field: 'url', title: __('Url'), formatter: Table.api.formatter.url},
28 {field: 'ip', title: __('IP'), events: Table.api.events.ip, formatter: Table.api.formatter.search}, 28 {field: 'ip', title: __('IP'), events: Table.api.events.ip, formatter: Table.api.formatter.search},
29 {field: 'browser', title: __('Browser'), operate: false, formatter: Controller.api.formatter.browser}, 29 {field: 'browser', title: __('Browser'), operate: false, formatter: Controller.api.formatter.browser},
30 {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, 30 {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 @@ -58,4 +58,4 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
58 } 58 }
59 }; 59 };
60 return Controller; 60 return Controller;
61 -});  
  61 +});
@@ -28,7 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -28,7 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
28 [ 28 [
29 {checkbox: true}, 29 {checkbox: true},
30 {field: 'id', title: __('Id')}, 30 {field: 'id', title: __('Id')},
31 - {field: 'type', title: __('Type'), operate: false, searchList: Config.searchList, formatter: Table.api.formatter.normal}, 31 + {field: 'type', title: __('Type'), operate: false, searchList: Config.searchList, formatter: Table.api.formatter.label},
32 {field: 'name', title: __('Name'), align: 'left'}, 32 {field: 'name', title: __('Name'), align: 'left'},
33 {field: 'nickname', title: __('Nickname')}, 33 {field: 'nickname', title: __('Nickname')},
34 {field: 'flag', title: __('Flag'), formatter: Table.api.formatter.flag}, 34 {field: 'flag', title: __('Flag'), formatter: Table.api.formatter.flag},
@@ -22,7 +22,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin @@ -22,7 +22,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
22 sortName: 'id', 22 sortName: 'id',
23 columns: [ 23 columns: [
24 [ 24 [
25 - {field: 'state', checkbox: true,}, 25 + {field: 'state', checkbox: true},
26 {field: 'id', title: __('Id')}, 26 {field: 'id', title: __('Id')},
27 {field: 'admin_id', title: __('Admin_id'), visible: false, addClass: "selectpage", extend: "data-source='auth/admin/index' data-field='nickname'"}, 27 {field: 'admin_id', title: __('Admin_id'), visible: false, addClass: "selectpage", extend: "data-source='auth/admin/index' data-field='nickname'"},
28 {field: 'user_id', title: __('User_id'), visible: false, addClass: "selectpage", extend: "data-source='user/user/index' data-field='nickname'"}, 28 {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 @@ -70,9 +70,28 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
70 index_url: 'general/attachment/select', 70 index_url: 'general/attachment/select',
71 } 71 }
72 }); 72 });
  73 + var urlArr = [];
73 74
74 var table = $("#table"); 75 var table = $("#table");
75 76
  77 + table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table', function (e, row) {
  78 + if (e.type == 'check' || e.type == 'uncheck') {
  79 + row = [row];
  80 + } else {
  81 + urlArr = [];
  82 + }
  83 + $.each(row, function (i, j) {
  84 + if (e.type.indexOf("uncheck") > -1) {
  85 + var index = urlArr.indexOf(j.url);
  86 + if (index > -1) {
  87 + urlArr.splice(index, 1);
  88 + }
  89 + } else {
  90 + urlArr.indexOf(j.url) == -1 && urlArr.push(j.url);
  91 + }
  92 + });
  93 + });
  94 +
76 // 初始化表格 95 // 初始化表格
77 table.bootstrapTable({ 96 table.bootstrapTable({
78 url: $.fn.bootstrapTable.defaults.extend.index_url, 97 url: $.fn.bootstrapTable.defaults.extend.index_url,
@@ -81,10 +100,10 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin @@ -81,10 +100,10 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
81 showExport: false, 100 showExport: false,
82 columns: [ 101 columns: [
83 [ 102 [
84 - {field: 'state', checkbox: true,}, 103 + {field: 'state', checkbox: true},
85 {field: 'id', title: __('Id')}, 104 {field: 'id', title: __('Id')},
86 - {field: 'admin_id', title: __('Admin_id'), visible: false},  
87 - {field: 'user_id', title: __('User_id'), visible: false}, 105 + {field: 'admin_id', title: __('Admin_id'), formatter: Table.api.formatter.search, visible: false},
  106 + {field: 'user_id', title: __('User_id'), formatter: Table.api.formatter.search, visible: false},
88 {field: 'url', title: __('Preview'), formatter: Controller.api.formatter.thumb, operate: false}, 107 {field: 'url', title: __('Preview'), formatter: Controller.api.formatter.thumb, operate: false},
89 {field: 'imagewidth', title: __('Imagewidth'), operate: false}, 108 {field: 'imagewidth', title: __('Imagewidth'), operate: false},
90 {field: 'imageheight', title: __('Imageheight'), operate: false}, 109 {field: 'imageheight', title: __('Imageheight'), operate: false},
@@ -112,10 +131,10 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin @@ -112,10 +131,10 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
112 131
113 // 选中多个 132 // 选中多个
114 $(document).on("click", ".btn-choose-multi", function () { 133 $(document).on("click", ".btn-choose-multi", function () {
115 - var urlArr = new Array();  
116 - $.each(table.bootstrapTable("getAllSelections"), function (i, j) {  
117 - urlArr.push(j.url);  
118 - }); 134 + // var urlArr = [];
  135 + // $.each(table.bootstrapTable("getAllSelections"), function (i, j) {
  136 + // urlArr.push(j.url);
  137 + // });
119 var multiple = Backend.api.query('multiple'); 138 var multiple = Backend.api.query('multiple');
120 multiple = multiple == 'true' ? true : false; 139 multiple = multiple == 'true' ? true : false;
121 Fast.api.close({url: urlArr.join(","), multiple: multiple}); 140 Fast.api.close({url: urlArr.join(","), multiple: multiple});
@@ -52,89 +52,6 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi @@ -52,89 +52,6 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
52 Backend.api.addtabs($(this).data("url")); 52 Backend.api.addtabs($(this).data("url"));
53 }); 53 });
54 54
55 - //读取首次登录推荐插件列表  
56 - if (localStorage.getItem("fastep") == "installed") {  
57 - $.ajax({  
58 - url: Config.fastadmin.api_url + '/addon/recommend',  
59 - type: 'post',  
60 - dataType: 'jsonp',  
61 - success: function (ret) {  
62 - require(['template'], function (Template) {  
63 - var install = function (name, title) {  
64 - Fast.api.ajax({  
65 - url: 'addon/install',  
66 - data: {name: name, faversion: Config.fastadmin.version}  
67 - }, function (data, ret) {  
68 - Fast.api.refreshmenu();  
69 - });  
70 - };  
71 - $(document).on('click', '.btn-install', function () {  
72 - $(this).prop("disabled", true).addClass("disabled");  
73 - $("input[name=addon]:checked").each(function () {  
74 - install($(this).data("name"));  
75 - });  
76 - return false;  
77 - });  
78 - $(document).on('click', '.btn-notnow', function () {  
79 - Layer.closeAll();  
80 - });  
81 - Layer.open({  
82 - type: 1, skin: 'layui-layer-page', area: ["860px", "620px"], title: '',  
83 - content: Template.render(ret.tpl, {addonlist: ret.rows})  
84 - });  
85 - localStorage.setItem("fastep", "dashboard");  
86 - });  
87 - }  
88 - });  
89 - }  
90 -  
91 - //版本检测  
92 - var checkupdate = function (ignoreversion, tips) {  
93 - $.ajax({  
94 - url: Config.fastadmin.api_url + '/version/check',  
95 - type: 'post',  
96 - data: {version: Config.fastadmin.version},  
97 - dataType: 'jsonp',  
98 - success: function (ret) {  
99 - if (ret.data && ignoreversion !== ret.data.newversion) {  
100 - Layer.open({  
101 - title: __('Discover new version'),  
102 - maxHeight: 400,  
103 - 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,  
104 - btn: [__('Go to download'), __('Ignore this version'), __('Do not remind again')],  
105 - btn2: function (index, layero) {  
106 - localStorage.setItem("ignoreversion", ret.data.newversion);  
107 - },  
108 - btn3: function (index, layero) {  
109 - localStorage.setItem("ignoreversion", "*");  
110 - },  
111 - success: function (layero, index) {  
112 - $(".layui-layer-btn0", layero).attr("href", ret.data.downloadurl).attr("target", "_blank");  
113 - }  
114 - });  
115 - } else {  
116 - if (tips) {  
117 - Toastr.success(__('Currently is the latest version'));  
118 - }  
119 - }  
120 - }, error: function (e) {  
121 - if (tips) {  
122 - Toastr.error(__('Unknown data format') + ":" + e.message);  
123 - }  
124 - }  
125 - });  
126 - };  
127 -  
128 - //读取版本检测信息  
129 - var ignoreversion = localStorage.getItem("ignoreversion");  
130 - if (Config.fastadmin.checkupdate && ignoreversion !== "*") {  
131 - checkupdate(ignoreversion, false);  
132 - }  
133 - //手动检测版本信息  
134 - $("a[data-toggle='checkupdate']").on('click', function () {  
135 - checkupdate('', true);  
136 - });  
137 -  
138 //切换左侧sidebar显示隐藏 55 //切换左侧sidebar显示隐藏
139 $(document).on("click fa.event.toggleitem", ".sidebar-menu li > a", function (e) { 56 $(document).on("click fa.event.toggleitem", ".sidebar-menu li > a", function (e) {
140 $(".sidebar-menu li").removeClass("active"); 57 $(".sidebar-menu li").removeClass("active");
@@ -188,7 +105,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi @@ -188,7 +105,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
188 } 105 }
189 }); 106 });
190 107
191 - var multiplenav = Config.fastadmin.multiplenav; 108 + var multiplenav = $("#secondnav").size() > 0 ? true : false;
192 var firstnav = $("#firstnav .nav-addtabs"); 109 var firstnav = $("#firstnav .nav-addtabs");
193 var nav = multiplenav ? $("#secondnav .nav-addtabs") : firstnav; 110 var nav = multiplenav ? $("#secondnav .nav-addtabs") : firstnav;
194 111
@@ -287,7 +204,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi @@ -287,7 +204,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
287 if ($("ul.sidebar-menu li.active a").size() > 0) { 204 if ($("ul.sidebar-menu li.active a").size() > 0) {
288 $("ul.sidebar-menu li.active a").trigger("click"); 205 $("ul.sidebar-menu li.active a").trigger("click");
289 } else { 206 } else {
290 - if (Config.fastadmin.multiplenav) { 207 + if (multiplenav) {
291 $("li:first > a", firstnav).trigger("click"); 208 $("li:first > a", firstnav).trigger("click");
292 } else { 209 } else {
293 $("ul.sidebar-menu li a[url!='javascript:;']:first").trigger("click"); 210 $("ul.sidebar-menu li a[url!='javascript:;']:first").trigger("click");
@@ -104,6 +104,9 @@ require.config({ @@ -104,6 +104,9 @@ require.config({
104 deps: ['bootstrap', 'slimscroll'], 104 deps: ['bootstrap', 'slimscroll'],
105 exports: '$.AdminLTE' 105 exports: '$.AdminLTE'
106 }, 106 },
  107 + 'bootstrap-daterangepicker': [
  108 + 'moment/locale/zh-cn'
  109 + ],
107 'bootstrap-datetimepicker': [ 110 'bootstrap-datetimepicker': [
108 'moment/locale/zh-cn', 111 'moment/locale/zh-cn',
109 // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css', 112 // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
@@ -117,6 +117,9 @@ require.config({ @@ -117,6 +117,9 @@ require.config({
117 deps: ['bootstrap', 'slimscroll'], 117 deps: ['bootstrap', 'slimscroll'],
118 exports: '$.AdminLTE' 118 exports: '$.AdminLTE'
119 }, 119 },
  120 + 'bootstrap-daterangepicker': [
  121 + 'moment/locale/zh-cn'
  122 + ],
120 'bootstrap-datetimepicker': [ 123 'bootstrap-datetimepicker': [
121 'moment/locale/zh-cn', 124 'moment/locale/zh-cn',
122 // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css', 125 // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
@@ -184,8 +187,8 @@ require(['jquery', 'bootstrap'], function ($, undefined) { @@ -184,8 +187,8 @@ require(['jquery', 'bootstrap'], function ($, undefined) {
184 define("require-backend", function(){}); 187 define("require-backend", function(){});
185 188
186 define('../libs/require-css/css.min',[],function(){if("undefined"==typeof window)return{load:function(a,b,c){c()}};var a=document.getElementsByTagName("head")[0],b=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,c=!1,d=!0;b[1]||b[7]?c=parseInt(b[1])<6||parseInt(b[7])<=9:b[2]||b[8]?d=!1:b[4]&&(c=parseInt(b[4])<18);var e={};e.pluginBuilder="./css-builder";var f,g,h,i=function(){f=document.createElement("style"),a.appendChild(f),g=f.styleSheet||f.sheet},j=0,k=[],l=function(a){g.addImport(a),f.onload=function(){m()},j++,31==j&&(i(),j=0)},m=function(){h();var a=k.shift();return a?(h=a[1],void l(a[0])):void(h=null)},n=function(a,b){if(g&&g.addImport||i(),g&&g.addImport)h?k.push([a,b]):(l(a),h=b);else{f.textContent='@import "'+a+'";';var c=setInterval(function(){try{f.sheet.cssRules,clearInterval(c),b()}catch(a){}},10)}},o=function(b,c){var e=document.createElement("link");if(e.type="text/css",e.rel="stylesheet",d)e.onload=function(){e.onload=function(){},setTimeout(c,7)};else var f=setInterval(function(){for(var a=0;a<document.styleSheets.length;a++){var b=document.styleSheets[a];if(b.href==e.href)return clearInterval(f),c()}},10);e.href=b,a.appendChild(e)};return e.normalize=function(a,b){return".css"==a.substr(a.length-4,4)&&(a=a.substr(0,a.length-4)),b(a)},e.load=function(a,b,d,e){(c?n:o)(b.toUrl(a+".css"),d)},e}); 189 define('../libs/require-css/css.min',[],function(){if("undefined"==typeof window)return{load:function(a,b,c){c()}};var a=document.getElementsByTagName("head")[0],b=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,c=!1,d=!0;b[1]||b[7]?c=parseInt(b[1])<6||parseInt(b[7])<=9:b[2]||b[8]?d=!1:b[4]&&(c=parseInt(b[4])<18);var e={};e.pluginBuilder="./css-builder";var f,g,h,i=function(){f=document.createElement("style"),a.appendChild(f),g=f.styleSheet||f.sheet},j=0,k=[],l=function(a){g.addImport(a),f.onload=function(){m()},j++,31==j&&(i(),j=0)},m=function(){h();var a=k.shift();return a?(h=a[1],void l(a[0])):void(h=null)},n=function(a,b){if(g&&g.addImport||i(),g&&g.addImport)h?k.push([a,b]):(l(a),h=b);else{f.textContent='@import "'+a+'";';var c=setInterval(function(){try{f.sheet.cssRules,clearInterval(c),b()}catch(a){}},10)}},o=function(b,c){var e=document.createElement("link");if(e.type="text/css",e.rel="stylesheet",d)e.onload=function(){e.onload=function(){},setTimeout(c,7)};else var f=setInterval(function(){for(var a=0;a<document.styleSheets.length;a++){var b=document.styleSheets[a];if(b.href==e.href)return clearInterval(f),c()}},10);e.href=b,a.appendChild(e)};return e.normalize=function(a,b){return".css"==a.substr(a.length-4,4)&&(a=a.substr(0,a.length-4)),b(a)},e.load=function(a,b,d,e){(c?n:o)(b.toUrl(a+".css"),d)},e});
187 -/*! layer-v3.1.1 Web弹层组件 MIT License http://layer.layui.com/ By 贤心 */  
188 - ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},f=r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},n.icon!==-1&&n.icon!==t||(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"&#x4FE1;&#x606F;",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'<div class="layui-layer-title" style="'+(f?r.title[1]:"")+'">'+(f?r.title[0]:r.title)+"</div>":"";return r.zIndex=s,t([r.shade?'<div class="layui-layer-shade" id="layui-layer-shade'+a+'" times="'+a+'" style="'+("z-index:"+(s-1)+"; ")+'"></div>':"",'<div class="'+l[0]+(" layui-layer-"+o.type[r.type])+(0!=r.type&&2!=r.type||r.shade?"":" layui-layer-border")+" "+(r.skin||"")+'" id="'+l[0]+a+'" type="'+o.type[r.type]+'" times="'+a+'" showtime="'+r.time+'" conType="'+(e?"object":"string")+'" style="z-index: '+s+"; width:"+r.area[0]+";height:"+r.area[1]+(r.fixed?"":";position:absolute;")+'">'+(e&&2!=r.type?"":u)+'<div id="'+(r.id||"")+'" class="layui-layer-content'+(0==r.type&&r.icon!==-1?" layui-layer-padding":"")+(3==r.type?" layui-layer-loading"+r.icon:"")+'">'+(0==r.type&&r.icon!==-1?'<i class="layui-layer-ico layui-layer-ico'+r.icon+'"></i>':"")+(1==r.type&&e?"":r.content||"")+'</div><span class="layui-layer-setwin">'+function(){var e=c?'<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>':"";return r.closeBtn&&(e+='<a class="layui-layer-ico '+l[7]+" "+l[7]+(r.title?r.closeBtn:4==r.type?"1":"2")+'" href="javascript:;"></a>'),e}()+"</span>"+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t<i;t++)e+='<a class="'+l[6]+t+'">'+r.btn[t]+"</a>";return'<div class="'+l[6]+" layui-layer-btn-"+(r.btnAlign||"")+'">'+e+"</div>"}():"")+(r.resize?'<span class="layui-layer-resize"></span>':"")+"</div>"],u,i('<div class="layui-layer-move"></div>')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='<iframe scrolling="'+(t.content[1]||"auto")+'" allowtransparency="true" id="'+l[4]+a+'" name="'+l[4]+a+'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="'+t.content[0]+'"></iframe>';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'<i class="layui-layer-TipsG"></i>',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;a<c.stX&&(a=c.stX),a>f&&(a=f),o<c.stY&&(o=c.stY),o>u&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'<textarea class="layui-layer-input"'+a+">"+(e.value||"")+"</textarea>":function(){return'<input type="'+(1==e.formType?"password":"text")+'" class="layui-layer-input" value="'+(e.value||"")+'">'}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("&#x6700;&#x591A;&#x8F93;&#x5165;"+(e.maxlength||500)+"&#x4E2A;&#x5B57;&#x6570;",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a='<span class="'+n+'">'+t[0].title+"</span>";i<e;i++)a+="<span>"+t[i].title+"</span>";return a}(),content:'<ul class="layui-layer-tabmain">'+function(){var e=t.length,i=1,a="";if(e>0)for(a='<li class="layui-layer-tabli '+n+'">'+(t[0].content||"no content")+"</li>";i<e;i++)a+='<li class="layui-layer-tabli">'+(t[i].content||"no content")+"</li>";return a}()+"</ul>",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("&#x6CA1;&#x6709;&#x56FE;&#x7247;")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)?.9:t["shade"],scrollbar:!("scrollbar"in t)?!1:t["scrollbar"]}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]<r[1]&&(a[0]=a[0]/r[1],a[1]=a[1]/r[1])}return[a[0]+"px",a[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,isOutAnim:!1,skin:"layui-layer-photos"+c("photos"),content:'<div class="layui-layer-phimg"><img src="'+u[d].src+'" alt="'+(u[d].alt||"")+'" layer-pid="'+u[d].pid+'"><div class="layui-layer-imgsee">'+(u.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(a?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(u[d].alt||"")+"</a><em>"+s.imgIndex+"/"+u.length+"</em></span></div></div></div>",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;",{time:3e4,btn:["&#x4E0B;&#x4E00;&#x5F20;","&#x4E0D;&#x770B;&#x4E86;"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define('layer',["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window); 190 +/*! layer-v3.1.4 Web弹层组件 MIT License http://layer.layui.com/ By 贤心 */
  191 + ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},f=r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},n.icon!==-1&&n.icon!==t||(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"&#x4FE1;&#x606F;",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,focusBtn:0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'<div class="layui-layer-title" style="'+(f?r.title[1]:"")+'">'+(f?r.title[0]:r.title)+"</div>":"";return r.zIndex=s,t([r.shade?'<div class="layui-layer-shade" id="layui-layer-shade'+a+'" times="'+a+'" style="'+("z-index:"+(s-1)+"; ")+'"></div>':"",'<div class="'+l[0]+(" layui-layer-"+o.type[r.type])+(0!=r.type&&2!=r.type||r.shade?"":" layui-layer-border")+" "+(r.skin||"")+'" id="'+l[0]+a+'" type="'+o.type[r.type]+'" times="'+a+'" showtime="'+r.time+'" conType="'+(e?"object":"string")+'" style="z-index: '+s+"; width:"+r.area[0]+";height:"+r.area[1]+(r.fixed?"":";position:absolute;")+'">'+(e&&2!=r.type?"":u)+'<div id="'+(r.id||"")+'" class="layui-layer-content'+(0==r.type&&r.icon!==-1?" layui-layer-padding":"")+(3==r.type?" layui-layer-loading"+r.icon:"")+'">'+(0==r.type&&r.icon!==-1?'<i class="layui-layer-ico layui-layer-ico'+r.icon+'"></i>':"")+(1==r.type&&e?"":r.content||"")+'</div><span class="layui-layer-setwin">'+function(){var e=c?'<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>':"";return r.closeBtn&&(e+='<a class="layui-layer-ico '+l[7]+" "+l[7]+(r.title?r.closeBtn:4==r.type?"1":"2")+'" href="javascript:;"></a>'),e}()+"</span>"+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t<i;t++)e+='<a class="'+l[6]+t+'" href="javascript:;">'+r.btn[t]+"</a>";return'<div class="'+l[6]+" layui-layer-btn-"+(r.btnAlign||"")+'">'+e+"</div>"}():"")+(r.resize?'<span class="layui-layer-resize"></span>':"")+"</div>"],u,i('<div class="layui-layer-move"></div>')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='<iframe scrolling="'+(t.content[1]||"auto")+'" allowtransparency="true" id="'+l[4]+a+'" name="'+l[4]+a+'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="'+t.content[0]+'"></iframe>';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'<i class="layui-layer-TipsG"></i>',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;a<c.stX&&(a=c.stX),a>f&&(a=f),o<c.stY&&(o=c.stY),o>u&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;if(t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),"number"==typeof a.focusBtn){var s=n.find("."+l[6]).children("a").eq(a.focusBtn);if(s.size()>0){var f=s.position(),c={width:s.outerWidth(),height:s.outerHeight(),left:f.left,top:f.top,marginTop:s.css("marginTop"),marginLeft:s.css("marginLeft")},u=i("<button class='layui-layer-confirm'></button>").css(c);n.find("."+l[6]).after(u),u.focus().click(function(){return s.trigger("click"),!1}).on("focus blur",function(e){s.toggleClass("focus","focus"===e.type)})}}n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'<textarea class="layui-layer-input"'+a+">"+(e.value||"")+"</textarea>":function(){return'<input type="'+(1==e.formType?"password":"text")+'" class="layui-layer-input" value="'+(e.value||"")+'">'}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("&#x6700;&#x591A;&#x8F93;&#x5165;"+(e.maxlength||500)+"&#x4E2A;&#x5B57;&#x6570;",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a='<span class="'+n+'">'+t[0].title+"</span>";i<e;i++)a+="<span>"+t[i].title+"</span>";return a}(),content:'<ul class="layui-layer-tabmain">'+function(){var e=t.length,i=1,a="";if(e>0)for(a='<li class="layui-layer-tabli '+n+'">'+(t[0].content||"no content")+"</li>";i<e;i++)a+='<li class="layui-layer-tabli">'+(t[i].content||"no content")+"</li>";return a}()+"</ul>",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("&#x6CA1;&#x6709;&#x56FE;&#x7247;")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:"shade"in t?t.shade:.9,scrollbar:"scrollbar"in t&&t.scrollbar}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]<r[1]&&(a[0]=a[0]/r[1],a[1]=a[1]/r[1])}return[a[0]+"px",a[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,isOutAnim:!1,skin:"layui-layer-photos"+c("photos"),content:'<div class="layui-layer-phimg"><img src="'+u[d].src+'" alt="'+(u[d].alt||"")+'" layer-pid="'+u[d].pid+'"><div class="layui-layer-imgsee">'+(u.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(a?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(u[d].alt||"")+"</a><em>"+s.imgIndex+"/"+u.length+"</em></span></div></div></div>",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;",{time:3e4,btn:["&#x4E0B;&#x4E00;&#x5F20;","&#x4E0D;&#x770B;&#x4E86;"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define('layer',["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);
189 /* 192 /*
190 * Toastr 193 * Toastr
191 * Copyright 2012-2015 194 * Copyright 2012-2015
@@ -6209,7 +6212,7 @@ define('upload',['jquery', 'bootstrap', 'plupload', 'template'], function ($, un @@ -6209,7 +6212,7 @@ define('upload',['jquery', 'bootstrap', 'plupload', 'template'], function ($, un
6209 config: { 6212 config: {
6210 container: document.body, 6213 container: document.body,
6211 classname: '.plupload:not([initialized])', 6214 classname: '.plupload:not([initialized])',
6212 - 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>', 6215 + 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>',
6213 }, 6216 },
6214 events: { 6217 events: {
6215 onInit: function (up) { 6218 onInit: function (up) {
@@ -6641,6 +6644,7 @@ define('upload',['jquery', 'bootstrap', 'plupload', 'template'], function ($, un @@ -6641,6 +6644,7 @@ define('upload',['jquery', 'bootstrap', 'plupload', 'template'], function ($, un
6641 6644
6642 return Upload; 6645 return Upload;
6643 }); 6646 });
  6647 +
6644 /*! nice-validator 1.1.4 6648 /*! nice-validator 1.1.4
6645 * (c) 2012-2018 Jony Zhang <niceue@live.com>, MIT Licensed 6649 * (c) 2012-2018 Jony Zhang <niceue@live.com>, MIT Licensed
6646 * https://github.com/niceue/nice-validator 6650 * https://github.com/niceue/nice-validator
@@ -10504,6 +10508,8 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr @@ -10504,6 +10508,8 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
10504 return html; 10508 return html;
10505 }, 10509 },
10506 toggle: function (value, row, index) { 10510 toggle: function (value, row, index) {
  10511 + var table = this.table;
  10512 + var options = table ? table.bootstrapTable('getOptions') : {};
10507 var color = typeof this.color !== 'undefined' ? this.color : 'success'; 10513 var color = typeof this.color !== 'undefined' ? this.color : 'success';
10508 var yes = typeof this.yes !== 'undefined' ? this.yes : 1; 10514 var yes = typeof this.yes !== 'undefined' ? this.yes : 1;
10509 var no = typeof this.no !== 'undefined' ? this.no : 0; 10515 var no = typeof this.no !== 'undefined' ? this.no : 0;
@@ -10513,7 +10519,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr @@ -10513,7 +10519,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
10513 disable = typeof this.disable === "function" ? this.disable.call(this, value, row, index) : this.disable; 10519 disable = typeof this.disable === "function" ? this.disable.call(this, value, row, index) : this.disable;
10514 } 10520 }
10515 return "<a href='javascript:;' data-toggle='tooltip' title='" + __('Click to toggle') + "' class='btn-change " + (disable ? 'btn disabled' : '') + "' data-id='" 10521 return "<a href='javascript:;' data-toggle='tooltip' title='" + __('Click to toggle') + "' class='btn-change " + (disable ? 'btn disabled' : '') + "' data-id='"
10516 - + 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>"; 10522 + + 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>";
10517 }, 10523 },
10518 url: function (value, row, index) { 10524 url: function (value, row, index) {
10519 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>'; 10525 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>';
@@ -103,6 +103,9 @@ require.config({ @@ -103,6 +103,9 @@ require.config({
103 deps: ['bootstrap', 'slimscroll'], 103 deps: ['bootstrap', 'slimscroll'],
104 exports: '$.AdminLTE' 104 exports: '$.AdminLTE'
105 }, 105 },
  106 + 'bootstrap-daterangepicker': [
  107 + 'moment/locale/zh-cn'
  108 + ],
106 'bootstrap-datetimepicker': [ 109 'bootstrap-datetimepicker': [
107 'moment/locale/zh-cn', 110 'moment/locale/zh-cn',
108 // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css', 111 // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
@@ -116,6 +116,9 @@ require.config({ @@ -116,6 +116,9 @@ require.config({
116 deps: ['bootstrap', 'slimscroll'], 116 deps: ['bootstrap', 'slimscroll'],
117 exports: '$.AdminLTE' 117 exports: '$.AdminLTE'
118 }, 118 },
  119 + 'bootstrap-daterangepicker': [
  120 + 'moment/locale/zh-cn'
  121 + ],
119 'bootstrap-datetimepicker': [ 122 'bootstrap-datetimepicker': [
120 'moment/locale/zh-cn', 123 'moment/locale/zh-cn',
121 // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css', 124 // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
@@ -177,8 +180,8 @@ require(['jquery', 'bootstrap'], function ($, undefined) { @@ -177,8 +180,8 @@ require(['jquery', 'bootstrap'], function ($, undefined) {
177 define("require-frontend", function(){}); 180 define("require-frontend", function(){});
178 181
179 define('../libs/require-css/css.min',[],function(){if("undefined"==typeof window)return{load:function(a,b,c){c()}};var a=document.getElementsByTagName("head")[0],b=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,c=!1,d=!0;b[1]||b[7]?c=parseInt(b[1])<6||parseInt(b[7])<=9:b[2]||b[8]?d=!1:b[4]&&(c=parseInt(b[4])<18);var e={};e.pluginBuilder="./css-builder";var f,g,h,i=function(){f=document.createElement("style"),a.appendChild(f),g=f.styleSheet||f.sheet},j=0,k=[],l=function(a){g.addImport(a),f.onload=function(){m()},j++,31==j&&(i(),j=0)},m=function(){h();var a=k.shift();return a?(h=a[1],void l(a[0])):void(h=null)},n=function(a,b){if(g&&g.addImport||i(),g&&g.addImport)h?k.push([a,b]):(l(a),h=b);else{f.textContent='@import "'+a+'";';var c=setInterval(function(){try{f.sheet.cssRules,clearInterval(c),b()}catch(a){}},10)}},o=function(b,c){var e=document.createElement("link");if(e.type="text/css",e.rel="stylesheet",d)e.onload=function(){e.onload=function(){},setTimeout(c,7)};else var f=setInterval(function(){for(var a=0;a<document.styleSheets.length;a++){var b=document.styleSheets[a];if(b.href==e.href)return clearInterval(f),c()}},10);e.href=b,a.appendChild(e)};return e.normalize=function(a,b){return".css"==a.substr(a.length-4,4)&&(a=a.substr(0,a.length-4)),b(a)},e.load=function(a,b,d,e){(c?n:o)(b.toUrl(a+".css"),d)},e}); 182 define('../libs/require-css/css.min',[],function(){if("undefined"==typeof window)return{load:function(a,b,c){c()}};var a=document.getElementsByTagName("head")[0],b=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,c=!1,d=!0;b[1]||b[7]?c=parseInt(b[1])<6||parseInt(b[7])<=9:b[2]||b[8]?d=!1:b[4]&&(c=parseInt(b[4])<18);var e={};e.pluginBuilder="./css-builder";var f,g,h,i=function(){f=document.createElement("style"),a.appendChild(f),g=f.styleSheet||f.sheet},j=0,k=[],l=function(a){g.addImport(a),f.onload=function(){m()},j++,31==j&&(i(),j=0)},m=function(){h();var a=k.shift();return a?(h=a[1],void l(a[0])):void(h=null)},n=function(a,b){if(g&&g.addImport||i(),g&&g.addImport)h?k.push([a,b]):(l(a),h=b);else{f.textContent='@import "'+a+'";';var c=setInterval(function(){try{f.sheet.cssRules,clearInterval(c),b()}catch(a){}},10)}},o=function(b,c){var e=document.createElement("link");if(e.type="text/css",e.rel="stylesheet",d)e.onload=function(){e.onload=function(){},setTimeout(c,7)};else var f=setInterval(function(){for(var a=0;a<document.styleSheets.length;a++){var b=document.styleSheets[a];if(b.href==e.href)return clearInterval(f),c()}},10);e.href=b,a.appendChild(e)};return e.normalize=function(a,b){return".css"==a.substr(a.length-4,4)&&(a=a.substr(0,a.length-4)),b(a)},e.load=function(a,b,d,e){(c?n:o)(b.toUrl(a+".css"),d)},e});
180 -/*! layer-v3.1.1 Web弹层组件 MIT License http://layer.layui.com/ By 贤心 */  
181 - ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},f=r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},n.icon!==-1&&n.icon!==t||(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"&#x4FE1;&#x606F;",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'<div class="layui-layer-title" style="'+(f?r.title[1]:"")+'">'+(f?r.title[0]:r.title)+"</div>":"";return r.zIndex=s,t([r.shade?'<div class="layui-layer-shade" id="layui-layer-shade'+a+'" times="'+a+'" style="'+("z-index:"+(s-1)+"; ")+'"></div>':"",'<div class="'+l[0]+(" layui-layer-"+o.type[r.type])+(0!=r.type&&2!=r.type||r.shade?"":" layui-layer-border")+" "+(r.skin||"")+'" id="'+l[0]+a+'" type="'+o.type[r.type]+'" times="'+a+'" showtime="'+r.time+'" conType="'+(e?"object":"string")+'" style="z-index: '+s+"; width:"+r.area[0]+";height:"+r.area[1]+(r.fixed?"":";position:absolute;")+'">'+(e&&2!=r.type?"":u)+'<div id="'+(r.id||"")+'" class="layui-layer-content'+(0==r.type&&r.icon!==-1?" layui-layer-padding":"")+(3==r.type?" layui-layer-loading"+r.icon:"")+'">'+(0==r.type&&r.icon!==-1?'<i class="layui-layer-ico layui-layer-ico'+r.icon+'"></i>':"")+(1==r.type&&e?"":r.content||"")+'</div><span class="layui-layer-setwin">'+function(){var e=c?'<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>':"";return r.closeBtn&&(e+='<a class="layui-layer-ico '+l[7]+" "+l[7]+(r.title?r.closeBtn:4==r.type?"1":"2")+'" href="javascript:;"></a>'),e}()+"</span>"+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t<i;t++)e+='<a class="'+l[6]+t+'">'+r.btn[t]+"</a>";return'<div class="'+l[6]+" layui-layer-btn-"+(r.btnAlign||"")+'">'+e+"</div>"}():"")+(r.resize?'<span class="layui-layer-resize"></span>':"")+"</div>"],u,i('<div class="layui-layer-move"></div>')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='<iframe scrolling="'+(t.content[1]||"auto")+'" allowtransparency="true" id="'+l[4]+a+'" name="'+l[4]+a+'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="'+t.content[0]+'"></iframe>';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'<i class="layui-layer-TipsG"></i>',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;a<c.stX&&(a=c.stX),a>f&&(a=f),o<c.stY&&(o=c.stY),o>u&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'<textarea class="layui-layer-input"'+a+">"+(e.value||"")+"</textarea>":function(){return'<input type="'+(1==e.formType?"password":"text")+'" class="layui-layer-input" value="'+(e.value||"")+'">'}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("&#x6700;&#x591A;&#x8F93;&#x5165;"+(e.maxlength||500)+"&#x4E2A;&#x5B57;&#x6570;",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a='<span class="'+n+'">'+t[0].title+"</span>";i<e;i++)a+="<span>"+t[i].title+"</span>";return a}(),content:'<ul class="layui-layer-tabmain">'+function(){var e=t.length,i=1,a="";if(e>0)for(a='<li class="layui-layer-tabli '+n+'">'+(t[0].content||"no content")+"</li>";i<e;i++)a+='<li class="layui-layer-tabli">'+(t[i].content||"no content")+"</li>";return a}()+"</ul>",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("&#x6CA1;&#x6709;&#x56FE;&#x7247;")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)?.9:t["shade"],scrollbar:!("scrollbar"in t)?!1:t["scrollbar"]}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]<r[1]&&(a[0]=a[0]/r[1],a[1]=a[1]/r[1])}return[a[0]+"px",a[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,isOutAnim:!1,skin:"layui-layer-photos"+c("photos"),content:'<div class="layui-layer-phimg"><img src="'+u[d].src+'" alt="'+(u[d].alt||"")+'" layer-pid="'+u[d].pid+'"><div class="layui-layer-imgsee">'+(u.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(a?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(u[d].alt||"")+"</a><em>"+s.imgIndex+"/"+u.length+"</em></span></div></div></div>",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;",{time:3e4,btn:["&#x4E0B;&#x4E00;&#x5F20;","&#x4E0D;&#x770B;&#x4E86;"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define('layer',["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window); 183 +/*! layer-v3.1.4 Web弹层组件 MIT License http://layer.layui.com/ By 贤心 */
  184 + ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},f=r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},n.icon!==-1&&n.icon!==t||(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"&#x4FE1;&#x606F;",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,focusBtn:0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'<div class="layui-layer-title" style="'+(f?r.title[1]:"")+'">'+(f?r.title[0]:r.title)+"</div>":"";return r.zIndex=s,t([r.shade?'<div class="layui-layer-shade" id="layui-layer-shade'+a+'" times="'+a+'" style="'+("z-index:"+(s-1)+"; ")+'"></div>':"",'<div class="'+l[0]+(" layui-layer-"+o.type[r.type])+(0!=r.type&&2!=r.type||r.shade?"":" layui-layer-border")+" "+(r.skin||"")+'" id="'+l[0]+a+'" type="'+o.type[r.type]+'" times="'+a+'" showtime="'+r.time+'" conType="'+(e?"object":"string")+'" style="z-index: '+s+"; width:"+r.area[0]+";height:"+r.area[1]+(r.fixed?"":";position:absolute;")+'">'+(e&&2!=r.type?"":u)+'<div id="'+(r.id||"")+'" class="layui-layer-content'+(0==r.type&&r.icon!==-1?" layui-layer-padding":"")+(3==r.type?" layui-layer-loading"+r.icon:"")+'">'+(0==r.type&&r.icon!==-1?'<i class="layui-layer-ico layui-layer-ico'+r.icon+'"></i>':"")+(1==r.type&&e?"":r.content||"")+'</div><span class="layui-layer-setwin">'+function(){var e=c?'<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>':"";return r.closeBtn&&(e+='<a class="layui-layer-ico '+l[7]+" "+l[7]+(r.title?r.closeBtn:4==r.type?"1":"2")+'" href="javascript:;"></a>'),e}()+"</span>"+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t<i;t++)e+='<a class="'+l[6]+t+'" href="javascript:;">'+r.btn[t]+"</a>";return'<div class="'+l[6]+" layui-layer-btn-"+(r.btnAlign||"")+'">'+e+"</div>"}():"")+(r.resize?'<span class="layui-layer-resize"></span>':"")+"</div>"],u,i('<div class="layui-layer-move"></div>')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='<iframe scrolling="'+(t.content[1]||"auto")+'" allowtransparency="true" id="'+l[4]+a+'" name="'+l[4]+a+'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="'+t.content[0]+'"></iframe>';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'<i class="layui-layer-TipsG"></i>',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;a<c.stX&&(a=c.stX),a>f&&(a=f),o<c.stY&&(o=c.stY),o>u&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;if(t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),"number"==typeof a.focusBtn){var s=n.find("."+l[6]).children("a").eq(a.focusBtn);if(s.size()>0){var f=s.position(),c={width:s.outerWidth(),height:s.outerHeight(),left:f.left,top:f.top,marginTop:s.css("marginTop"),marginLeft:s.css("marginLeft")},u=i("<button class='layui-layer-confirm'></button>").css(c);n.find("."+l[6]).after(u),u.focus().click(function(){return s.trigger("click"),!1}).on("focus blur",function(e){s.toggleClass("focus","focus"===e.type)})}}n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'<textarea class="layui-layer-input"'+a+">"+(e.value||"")+"</textarea>":function(){return'<input type="'+(1==e.formType?"password":"text")+'" class="layui-layer-input" value="'+(e.value||"")+'">'}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("&#x6700;&#x591A;&#x8F93;&#x5165;"+(e.maxlength||500)+"&#x4E2A;&#x5B57;&#x6570;",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a='<span class="'+n+'">'+t[0].title+"</span>";i<e;i++)a+="<span>"+t[i].title+"</span>";return a}(),content:'<ul class="layui-layer-tabmain">'+function(){var e=t.length,i=1,a="";if(e>0)for(a='<li class="layui-layer-tabli '+n+'">'+(t[0].content||"no content")+"</li>";i<e;i++)a+='<li class="layui-layer-tabli">'+(t[i].content||"no content")+"</li>";return a}()+"</ul>",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("&#x6CA1;&#x6709;&#x56FE;&#x7247;")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:"shade"in t?t.shade:.9,scrollbar:"scrollbar"in t&&t.scrollbar}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]<r[1]&&(a[0]=a[0]/r[1],a[1]=a[1]/r[1])}return[a[0]+"px",a[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,isOutAnim:!1,skin:"layui-layer-photos"+c("photos"),content:'<div class="layui-layer-phimg"><img src="'+u[d].src+'" alt="'+(u[d].alt||"")+'" layer-pid="'+u[d].pid+'"><div class="layui-layer-imgsee">'+(u.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(a?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(u[d].alt||"")+"</a><em>"+s.imgIndex+"/"+u.length+"</em></span></div></div></div>",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;",{time:3e4,btn:["&#x4E0B;&#x4E00;&#x5F20;","&#x4E0D;&#x770B;&#x4E86;"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define('layer',["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);
182 /* 185 /*
183 * Toastr 186 * Toastr
184 * Copyright 2012-2015 187 * Copyright 2012-2015
@@ -523,6 +523,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table @@ -523,6 +523,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
523 return html; 523 return html;
524 }, 524 },
525 toggle: function (value, row, index) { 525 toggle: function (value, row, index) {
  526 + var table = this.table;
  527 + var options = table ? table.bootstrapTable('getOptions') : {};
526 var color = typeof this.color !== 'undefined' ? this.color : 'success'; 528 var color = typeof this.color !== 'undefined' ? this.color : 'success';
527 var yes = typeof this.yes !== 'undefined' ? this.yes : 1; 529 var yes = typeof this.yes !== 'undefined' ? this.yes : 1;
528 var no = typeof this.no !== 'undefined' ? this.no : 0; 530 var no = typeof this.no !== 'undefined' ? this.no : 0;
@@ -532,7 +534,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table @@ -532,7 +534,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
532 disable = typeof this.disable === "function" ? this.disable.call(this, value, row, index) : this.disable; 534 disable = typeof this.disable === "function" ? this.disable.call(this, value, row, index) : this.disable;
533 } 535 }
534 return "<a href='javascript:;' data-toggle='tooltip' title='" + __('Click to toggle') + "' class='btn-change " + (disable ? 'btn disabled' : '') + "' data-id='" 536 return "<a href='javascript:;' data-toggle='tooltip' title='" + __('Click to toggle') + "' class='btn-change " + (disable ? 'btn disabled' : '') + "' data-id='"
535 - + 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>"; 537 + + 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>";
536 }, 538 },
537 url: function (value, row, index) { 539 url: function (value, row, index) {
538 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>'; 540 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>';
@@ -4,7 +4,7 @@ define(['jquery', 'bootstrap', 'plupload', 'template'], function ($, undefined, @@ -4,7 +4,7 @@ define(['jquery', 'bootstrap', 'plupload', 'template'], function ($, undefined,
4 config: { 4 config: {
5 container: document.body, 5 container: document.body,
6 classname: '.plupload:not([initialized])', 6 classname: '.plupload:not([initialized])',
7 - 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>', 7 + 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>',
8 }, 8 },
9 events: { 9 events: {
10 onInit: function (up) { 10 onInit: function (up) {
@@ -435,4 +435,4 @@ define(['jquery', 'bootstrap', 'plupload', 'template'], function ($, undefined, @@ -435,4 +435,4 @@ define(['jquery', 'bootstrap', 'plupload', 'template'], function ($, undefined,
435 ; 435 ;
436 436
437 return Upload; 437 return Upload;
438 -});  
  438 +});
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 // 定义应用目录 13 // 定义应用目录
14 define('APP_PATH', __DIR__ . '/../application/'); 14 define('APP_PATH', __DIR__ . '/../application/');
15 15
16 -// 判断是否安装FastAdmin 16 +// 判断是否安装
17 if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) 17 if (!is_file(APP_PATH . 'admin/command/Install/install.lock'))
18 { 18 {
19 header("location:./install.php"); 19 header("location:./install.php");
1 <?php 1 <?php
2 -/**  
3 - * FastAdmin安装程序  
4 - *  
5 - * 安装完成后建议删除此文件  
6 - * @author Karson  
7 - * @website https://www.fastadmin.net  
8 - */  
9 -// error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);  
10 -// ini_set('display_errors', '1');  
11 -// 定义目录分隔符  
12 -define('DS', DIRECTORY_SEPARATOR);  
13 -  
14 -// 定义根目录  
15 -define('ROOT_PATH', __DIR__ . DS . '..' . DS);  
16 2
  3 +// +----------------------------------------------------------------------
  4 +// | ThinkPHP [ WE CAN DO IT JUST THINK ]
  5 +// +----------------------------------------------------------------------
  6 +// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
  7 +// +----------------------------------------------------------------------
  8 +// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  9 +// +----------------------------------------------------------------------
  10 +// | Author: liu21st <liu21st@gmail.com>
  11 +// +----------------------------------------------------------------------
  12 +// [ 安装文件 ]
  13 +// 建议安装完成后移除此文件
17 // 定义应用目录 14 // 定义应用目录
18 -define('APP_PATH', ROOT_PATH . 'application' . DS);  
19 -  
20 -// 安装包目录  
21 -define('INSTALL_PATH', APP_PATH . 'admin' . DS . 'command' . DS . 'Install' . DS);  
22 -  
23 -// 判断文件或目录是否有写的权限  
24 -function is_really_writable($file)  
25 -{  
26 - if (DIRECTORY_SEPARATOR == '/' AND @ ini_get("safe_mode") == false) {  
27 - return is_writable($file);  
28 - }  
29 - if (!is_file($file) OR ($fp = @fopen($file, "r+")) === false) {  
30 - return false;  
31 - }  
32 -  
33 - fclose($fp);  
34 - return true;  
35 -}  
36 -  
37 -$sitename = "FastAdmin";  
38 -  
39 -$link = array(  
40 - 'qqun' => "https://jq.qq.com/?_wv=1027&amp;k=487PNBb",  
41 - 'gitee' => 'https://gitee.com/karson/fastadmin/attach_files',  
42 - 'home' => 'https://www.fastadmin.net?ref=install',  
43 - 'forum' => 'https://forum.fastadmin.net?ref=install',  
44 - 'doc' => 'https://doc.fastadmin.net?ref=install',  
45 -);  
46 -  
47 -// 检测目录是否存在  
48 -$checkDirs = [  
49 - 'thinkphp',  
50 - 'vendor',  
51 - 'public' . DS . 'assets' . DS . 'libs'  
52 -];  
53 -//缓存目录  
54 -$runtimeDir = APP_PATH . 'runtime';  
55 -  
56 -//错误信息  
57 -$errInfo = '';  
58 -  
59 -//数据库配置文件  
60 -$dbConfigFile = APP_PATH . 'database.php';  
61 -  
62 -//后台入口文件  
63 -$adminFile = ROOT_PATH . 'public' . DS . 'admin.php';  
64 -  
65 -// 锁定的文件  
66 -$lockFile = INSTALL_PATH . 'install.lock';  
67 -if (is_file($lockFile)) {  
68 - $errInfo = "当前已经安装{$sitename},如果需要重新安装,请手动移除application/admin/command/Install/install.lock文件";  
69 -} else {  
70 - if (version_compare(PHP_VERSION, '5.5.0', '<')) {  
71 - $errInfo = "当前版本(" . PHP_VERSION . ")过低,请使用PHP5.5以上版本";  
72 - } else {  
73 - if (!extension_loaded("PDO")) {  
74 - $errInfo = "当前未开启PDO,无法进行安装";  
75 - } else {  
76 - if (!is_really_writable($dbConfigFile)) {  
77 - $open_basedir = ini_get('open_basedir');  
78 - if ($open_basedir) {  
79 - $dirArr = explode(PATH_SEPARATOR, $open_basedir);  
80 - if ($dirArr && in_array(__DIR__, $dirArr)) {  
81 - $errInfo = '当前服务器因配置了open_basedir,导致无法读取父目录<br><a href="https://forum.fastadmin.net/thread/1145?ref=install" target="_blank">点击查看解决办法</a>';  
82 - }  
83 - }  
84 - if (!$errInfo) {  
85 - $errInfo = '当前权限不足,无法写入配置文件application/database.php<br><a href="https://forum.fastadmin.net/thread/1145?ref=install" target="_blank">点击查看解决办法</a>';  
86 - }  
87 - } else {  
88 - $dirArr = [];  
89 - foreach ($checkDirs as $k => $v) {  
90 - if (!is_dir(ROOT_PATH . $v)) {  
91 - $errInfo = '当前代码仅包含核心代码,请前往官网下载完整包或资源包覆盖后再尝试安装,<a href="https://www.fastadmin.net/download.html?ref=install" target="_blank">立即前往下载</a>';  
92 - break;  
93 - }  
94 - }  
95 - }  
96 - }  
97 - }  
98 -}  
99 -// 当前是POST请求  
100 -if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {  
101 - if ($errInfo) {  
102 - echo $errInfo;  
103 - exit;  
104 - }  
105 - $err = '';  
106 - $mysqlHostname = isset($_POST['mysqlHost']) ? $_POST['mysqlHost'] : '127.0.0.1';  
107 - $mysqlHostport = isset($_POST['mysqlHostport']) ? $_POST['mysqlHostport'] : 3306;  
108 - $hostArr = explode(':', $mysqlHostname);  
109 - if (count($hostArr) > 1) {  
110 - $mysqlHostname = $hostArr[0];  
111 - $mysqlHostport = $hostArr[1];  
112 - }  
113 - $mysqlUsername = isset($_POST['mysqlUsername']) ? $_POST['mysqlUsername'] : 'root';  
114 - $mysqlPassword = isset($_POST['mysqlPassword']) ? $_POST['mysqlPassword'] : '';  
115 - $mysqlDatabase = isset($_POST['mysqlDatabase']) ? $_POST['mysqlDatabase'] : 'fastadmin';  
116 - $mysqlPrefix = isset($_POST['mysqlPrefix']) ? $_POST['mysqlPrefix'] : 'fa_';  
117 - $adminUsername = isset($_POST['adminUsername']) ? $_POST['adminUsername'] : 'admin';  
118 - $adminPassword = isset($_POST['adminPassword']) ? $_POST['adminPassword'] : '123456';  
119 - $adminPasswordConfirmation = isset($_POST['adminPasswordConfirmation']) ? $_POST['adminPasswordConfirmation'] : '123456';  
120 - $adminEmail = isset($_POST['adminEmail']) ? $_POST['adminEmail'] : 'admin@admin.com';  
121 -  
122 - if (!preg_match("/^\w{3,12}$/", $adminUsername)) {  
123 - echo "用户名只能由3-12位数字、字母、下划线组合";  
124 - exit;  
125 - }  
126 - if (!preg_match("/^[\S]{6,16}$/", $adminPassword)) {  
127 - echo "密码长度必须在6-16位之间,不能包含空格";  
128 - exit;  
129 - }  
130 - if ($adminPassword !== $adminPasswordConfirmation) {  
131 - echo "两次输入的密码不一致";  
132 - exit;  
133 - }  
134 -  
135 - try {  
136 - //检测能否读取安装文件  
137 - $sql = @file_get_contents(INSTALL_PATH . 'fastadmin.sql');  
138 - if (!$sql) {  
139 - throw new Exception("无法读取application/admin/command/Install/fastadmin.sql文件,请检查是否有读权限");  
140 - }  
141 - $sql = str_replace("`fa_", "`{$mysqlPrefix}", $sql);  
142 - $pdo = new PDO("mysql:host={$mysqlHostname};port={$mysqlHostport}", $mysqlUsername, $mysqlPassword, array(  
143 - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,  
144 - PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"  
145 - ));  
146 -  
147 - //检测是否支持innodb存储引擎  
148 - $pdoStatement = $pdo->query("SHOW VARIABLES LIKE 'innodb_version'");  
149 - $result = $pdoStatement->fetch();  
150 - if (!$result) {  
151 - throw new Exception("当前数据库不支持innodb存储引擎,请开启后再重新尝试安装");  
152 - }  
153 -  
154 - $pdo->query("CREATE DATABASE IF NOT EXISTS `{$mysqlDatabase}` CHARACTER SET utf8 COLLATE utf8_general_ci;");  
155 -  
156 - $pdo->query("USE `{$mysqlDatabase}`");  
157 -  
158 - $pdo->exec($sql);  
159 -  
160 - $config = @file_get_contents($dbConfigFile);  
161 - $callback = function ($matches) use ($mysqlHostname, $mysqlHostport, $mysqlUsername, $mysqlPassword, $mysqlDatabase, $mysqlPrefix) {  
162 - $field = ucfirst($matches[1]);  
163 - $replace = ${"mysql{$field}"};  
164 - if ($matches[1] == 'hostport' && $mysqlHostport == 3306) {  
165 - $replace = '';  
166 - }  
167 - return "'{$matches[1]}'{$matches[2]}=>{$matches[3]}Env::get('database.{$matches[1]}', '{$replace}'),";  
168 - };  
169 - $config = preg_replace_callback("/'(hostname|database|username|password|hostport|prefix)'(\s+)=>(\s+)Env::get\((.*)\)\,/", $callback, $config);  
170 -  
171 - //检测能否成功写入数据库配置  
172 - $result = @file_put_contents($dbConfigFile, $config);  
173 - if (!$result) {  
174 - throw new Exception("无法写入数据库信息到application/database.php文件,请检查是否有写权限");  
175 - }  
176 -  
177 - //检测能否成功写入lock文件  
178 - $result = @file_put_contents($lockFile, 1);  
179 - if (!$result) {  
180 - throw new Exception("无法写入安装锁定到application/admin/command/Install/install.lock文件,请检查是否有写权限");  
181 - }  
182 -  
183 - $newSalt = substr(md5(uniqid(true)), 0, 6);  
184 - $newPassword = md5(md5($adminPassword) . $newSalt);  
185 - $pdo->query("UPDATE {$mysqlPrefix}admin SET username = '{$adminUsername}', email = '{$adminEmail}',password = '{$newPassword}', salt = '{$newSalt}' WHERE username = 'admin'");  
186 -  
187 - $adminName = '';  
188 - if (is_file($adminFile)) {  
189 - $x = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';  
190 - $adminName = substr(str_shuffle(str_repeat($x, ceil(10 / strlen($x)))), 1, 10) . '.php';  
191 - rename($adminFile, ROOT_PATH . 'public' . DS . $adminName);  
192 - }  
193 - echo "success|{$adminName}";  
194 - } catch (PDOException $e) {  
195 - $err = $e->getMessage();  
196 - } catch (Exception $e) {  
197 - $err = $e->getMessage();  
198 - }  
199 - echo $err;  
200 - exit;  
201 -}  
202 -?>  
203 -<!doctype html>  
204 -<html>  
205 -<head>  
206 - <meta charset="utf-8">  
207 - <meta http-equiv="X-UA-Compatible" content="IE=edge">  
208 - <title>安装<?php echo $sitename; ?></title>  
209 - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">  
210 - <meta name="renderer" content="webkit">  
211 -  
212 - <style>  
213 - body {  
214 - background: #fff;  
215 - margin: 0;  
216 - padding: 0;  
217 - line-height: 1.5;  
218 - -webkit-font-smoothing: antialiased;  
219 - -moz-osx-font-smoothing: grayscale;  
220 - }  
221 -  
222 - body, input, button {  
223 - font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, 'Microsoft Yahei', Arial, sans-serif;  
224 - font-size: 14px;  
225 - color: #7E96B3;  
226 - }  
227 -  
228 - .container {  
229 - max-width: 480px;  
230 - margin: 0 auto;  
231 - padding: 20px;  
232 - text-align: center;  
233 - }  
234 -  
235 - a {  
236 - color: #18bc9c;  
237 - text-decoration: none;  
238 - }  
239 -  
240 - a:hover {  
241 - text-decoration: underline;  
242 - }  
243 -  
244 - h1 {  
245 - margin-top: 0;  
246 - margin-bottom: 10px;  
247 - }  
248 -  
249 - h2 {  
250 - font-size: 28px;  
251 - font-weight: normal;  
252 - color: #3C5675;  
253 - margin-bottom: 0;  
254 - margin-top: 0;  
255 - }  
256 -  
257 - form {  
258 - margin-top: 40px;  
259 - }  
260 -  
261 - .form-group {  
262 - margin-bottom: 20px;  
263 - }  
264 -  
265 - .form-group .form-field:first-child input {  
266 - border-top-left-radius: 4px;  
267 - border-top-right-radius: 4px;  
268 - }  
269 -  
270 - .form-group .form-field:last-child input {  
271 - border-bottom-left-radius: 4px;  
272 - border-bottom-right-radius: 4px;  
273 - }  
274 -  
275 - .form-field input {  
276 - background: #EDF2F7;  
277 - margin: 0 0 1px;  
278 - border: 2px solid transparent;  
279 - transition: background 0.2s, border-color 0.2s, color 0.2s;  
280 - width: 100%;  
281 - padding: 15px 15px 15px 180px;  
282 - box-sizing: border-box;  
283 - }  
284 -  
285 - .form-field input:focus {  
286 - border-color: #18bc9c;  
287 - background: #fff;  
288 - color: #444;  
289 - outline: none;  
290 - }  
291 -  
292 - .form-field label {  
293 - float: left;  
294 - width: 160px;  
295 - text-align: right;  
296 - margin-right: -160px;  
297 - position: relative;  
298 - margin-top: 18px;  
299 - font-size: 14px;  
300 - pointer-events: none;  
301 - opacity: 0.7;  
302 - }  
303 -  
304 - button, .btn {  
305 - background: #3C5675;  
306 - color: #fff;  
307 - border: 0;  
308 - font-weight: bold;  
309 - border-radius: 4px;  
310 - cursor: pointer;  
311 - padding: 15px 30px;  
312 - -webkit-appearance: none;  
313 - }  
314 -  
315 - button[disabled] {  
316 - opacity: 0.5;  
317 - }  
318 -  
319 - .form-buttons {  
320 - height: 52px;  
321 - line-height: 52px;  
322 - }  
323 -  
324 - .form-buttons .btn {  
325 - margin-right: 5px;  
326 - }  
327 -  
328 - #error, .error, #success, .success, #warmtips, .warmtips {  
329 - background: #D83E3E;  
330 - color: #fff;  
331 - padding: 15px 20px;  
332 - border-radius: 4px;  
333 - margin-bottom: 20px;  
334 - }  
335 -  
336 - #success {  
337 - background: #3C5675;  
338 - }  
339 -  
340 - #error a, .error a {  
341 - color: white;  
342 - text-decoration: underline;  
343 - }  
344 -  
345 - #warmtips {  
346 - background: #ffcdcd;  
347 - font-size: 14px;  
348 - color: #e74c3c;  
349 - }  
350 -  
351 - #warmtips a {  
352 - background: #ffffff7a;  
353 - display: block;  
354 - height: 30px;  
355 - line-height: 30px;  
356 - margin-top: 10px;  
357 - color: #e21a1a;  
358 - border-radius: 3px;  
359 - }  
360 - </style>  
361 -</head>  
362 -  
363 -<body>  
364 -<div class="container">  
365 - <h1>  
366 - <svg width="80px" height="96px" viewBox="0 0 768 830" version="1.1" xmlns="http://www.w3.org/2000/svg"  
367 - xmlns:xlink="http://www.w3.org/1999/xlink">  
368 - <g id="logo" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">  
369 - <path d="M64.433651,605.899968 C20.067302,536.265612 0,469.698785 0,389.731348 C0,174.488668 171.922656,0 384,0 C596.077344,0 768,174.488668 768,389.731348 C768,469.698785 747.932698,536.265612 703.566349,605.899968 C614.4,753.480595 441.6,870.4 384,870.4 C326.4,870.4 153.6,753.480595 64.433651,605.899968 L64.433651,605.899968 Z"  
370 - id="body" fill="#18BC9C"></path>  
371 - <path d="M429.648991,190.816 L430.160991,190.816 L429.648991,190.816 L429.648991,190.816 Z M429.648991,156 L427.088991,156 C419.408991,157.024 411.728991,160.608 404.560991,168.8 L403.024991,170.848 L206.928991,429.92 C198.736991,441.184 197.712991,453.984 204.368991,466.784 C210.512991,478.048 222.288991,485.728 235.600991,485.728 L336.464991,486.24 L304.208991,673.632 C301.648991,689.504 310.352991,705.376 325.200991,712.032 C329.808991,714.08 334.416991,714.592 339.536991,714.592 C349.776991,714.592 358.992991,709.472 366.160991,700.256 L561.744991,419.168 C569.936991,407.904 570.960991,395.104 564.304991,382.304 C557.648991,369.504 547.408991,363.36 533.072991,363.36 L432.208991,363.36 L463.952991,199.008 C464.464991,196.448 464.976991,193.376 464.976991,190.816 C464.976991,171.872 449.104991,156 431.184991,156 L429.648991,156 L429.648991,156 Z"  
372 - id="flash" fill="#FFFFFF"></path>  
373 - </g>  
374 - </svg>  
375 - </h1>  
376 - <h2>安装 <?php echo $sitename; ?></h2>  
377 - <div>  
378 -  
379 - <p>若你在安装中遇到麻烦可点击 <a href="<?php echo $link['doc']; ?>" target="_blank">安装文档</a> <a  
380 - href="<?php echo $link['forum']; ?>" target="_blank">问答社区</a> <a  
381 - href="<?php echo $link['qqun']; ?>">QQ交流群</a></p>  
382 - <!--<p><?php echo $sitename; ?>还支持在命令行php think install一键安装</p>-->  
383 -  
384 - <form method="post">  
385 - <?php if ($errInfo): ?>  
386 - <div class="error">  
387 - <?php echo $errInfo; ?>  
388 - </div>  
389 - <?php endif; ?>  
390 - <div id="error" style="display:none"></div>  
391 - <div id="success" style="display:none"></div>  
392 - <div id="warmtips" style="display:none"></div>  
393 -  
394 - <div class="form-group">  
395 - <div class="form-field">  
396 - <label>MySQL 数据库地址</label>  
397 - <input type="text" name="mysqlHost" value="127.0.0.1" required="">  
398 - </div>  
399 -  
400 - <div class="form-field">  
401 - <label>MySQL 数据库名</label>  
402 - <input type="text" name="mysqlDatabase" value="fastadmin" required="">  
403 - </div>  
404 -  
405 - <div class="form-field">  
406 - <label>MySQL 用户名</label>  
407 - <input type="text" name="mysqlUsername" value="root" required="">  
408 - </div>  
409 -  
410 - <div class="form-field">  
411 - <label>MySQL 密码</label>  
412 - <input type="password" name="mysqlPassword">  
413 - </div>  
414 -  
415 - <div class="form-field">  
416 - <label>MySQL 数据表前缀</label>  
417 - <input type="text" name="mysqlPrefix" value="fa_">  
418 - </div>  
419 -  
420 - <div class="form-field">  
421 - <label>MySQL 端口号</label>  
422 - <input type="number" name="mysqlHostport" value="3306">  
423 - </div>  
424 - </div>  
425 -  
426 - <div class="form-group">  
427 - <div class="form-field">  
428 - <label>管理者用户名</label>  
429 - <input name="adminUsername" value="admin" required=""/>  
430 - </div>  
431 -  
432 - <div class="form-field">  
433 - <label>管理者Email</label>  
434 - <input name="adminEmail" value="admin@admin.com" required="">  
435 - </div>  
436 -  
437 - <div class="form-field">  
438 - <label>管理者密码</label>  
439 - <input type="password" name="adminPassword" required="">  
440 - </div>  
441 -  
442 - <div class="form-field">  
443 - <label>重复密码</label>  
444 - <input type="password" name="adminPasswordConfirmation" required="">  
445 - </div>  
446 - </div>  
447 -  
448 - <div class="form-buttons">  
449 - <button type="submit" <?php echo $errInfo ? 'disabled' : '' ?>>点击安装</button>  
450 - </div>  
451 - </form>  
452 -  
453 - <!-- jQuery -->  
454 - <script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>  
455 -  
456 - <script>  
457 - $(function () {  
458 - $('form :input:first').select(); 15 +define('APP_PATH', __DIR__ . '/../application/');
459 16
460 - $('form').on('submit', function (e) {  
461 - e.preventDefault();  
462 - var form = this;  
463 - var $button = $(this).find('button')  
464 - .text('安装中...')  
465 - .prop('disabled', true); 17 +// 加载框架引导文件
  18 +require __DIR__ . '/../thinkphp/base.php';
466 19
467 - $.post('', $(this).serialize())  
468 - .done(function (ret) {  
469 - if (ret.substr(0, 7) === 'success') {  
470 - var retArr = ret.split(/\|/);  
471 - $('#error').hide();  
472 - $(".form-group", form).remove();  
473 - $button.remove();  
474 - $("#success").text("安装成功!开始你的<?php echo $sitename; ?>之旅吧!").show(); 20 +// 绑定到安装控制器
  21 +\think\Route::bind('\app\admin\command\Install', 'controller');
475 22
476 - $buttons = $(".form-buttons", form);  
477 - $('<a class="btn" href="./">访问首页</a>').appendTo($buttons); 23 +// 关闭路由
  24 +\think\App::route(true);
478 25
479 - if (typeof retArr[1] !== 'undefined' && retArr[1] !== '') {  
480 - var url = location.href.replace(/install\.php/, retArr[1]);  
481 - $("#warmtips").html('温馨提示:请将以下后台登录入口添加到你的收藏夹,为了你的安全,不要泄漏或发送给他人!如有泄漏请及时修改!<a href="' + url + '">' + url + '</a>').show();  
482 - $('<a class="btn" href="' + url + '" id="btn-admin" style="background:#18bc9c">访问后台</a>').appendTo($buttons);  
483 - }  
484 - localStorage.setItem("fastep", "installed");  
485 - } else {  
486 - $('#error').show().text(ret);  
487 - $button.prop('disabled', false).text('点击安装');  
488 - $("html,body").animate({  
489 - scrollTop: 0  
490 - }, 500);  
491 - }  
492 - })  
493 - .fail(function (data) {  
494 - $('#error').show().text('发生错误:\n\n' + data.responseText);  
495 - $button.prop('disabled', false).text('点击安装');  
496 - $("html,body").animate({  
497 - scrollTop: 0  
498 - }, 500);  
499 - }); 26 +// 设置根url
  27 +\think\Url::root('');
500 28
501 - return false;  
502 - });  
503 - });  
504 - </script>  
505 - </div>  
506 -</div>  
507 -</body>  
508 -</html>  
  29 +// 执行应用
  30 +\think\App::run()->send();