From 63e0fb3fd55d34fe44119c8d0a0bf8f38dbc6ea8 Mon Sep 17 00:00:00 2001 From: kingang <443721842@qq.com> Date: Sat, 21 Dec 2019 15:04:13 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=AF=E9=80=89api?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/command/Api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/admin/command/Api.php b/application/admin/command/Api.php index 97f1f5ec..bfd9dce1 100644 --- a/application/admin/command/Api.php +++ b/application/admin/command/Api.php @@ -26,6 +26,7 @@ class Api extends Command ->addOption('author', 'a', Option::VALUE_OPTIONAL, 'document author', $site['name']) ->addOption('class', 'c', Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'extend class', null) ->addOption('language', 'l', Option::VALUE_OPTIONAL, 'language', 'zh-cn') + ->addOption('controller', 't', Option::VALUE_REQUIRED | Option::VALUE_IS_ARRAY, 'controller name', null) ->setDescription('Build Api document from controller'); } From efc92f71a902fba0df7c184f156310848da51aa3 Mon Sep 17 00:00:00 2001 From: kingang <443721842@qq.com> Date: Sat, 21 Dec 2019 15:10:05 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=AF=E9=80=89api?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/command/Api.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/application/admin/command/Api.php b/application/admin/command/Api.php index bfd9dce1..c2ce2f2c 100644 --- a/application/admin/command/Api.php +++ b/application/admin/command/Api.php @@ -81,16 +81,25 @@ class Api extends Command throw new Exception("Please make sure opcache already enabled, Get help:https://forum.fastadmin.net/d/1321"); } } + //控制器名 + $controller = $input->getOption('controller') ?: ''; + if(!$controller) { + $controllerDir = $moduleDir . Config::get('url_controller_layer') . DS; + $files = new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($controllerDir), + \RecursiveIteratorIterator::LEAVES_ONLY + ); - $controllerDir = $moduleDir . Config::get('url_controller_layer') . DS; - $files = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($controllerDir), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($files as $name => $file) { - if (!$file->isDir() && $file->getExtension() == 'php') { - $filePath = $file->getRealPath(); + foreach ($files as $name => $file) { + if (!$file->isDir() && $file->getExtension() == 'php') { + $filePath = $file->getRealPath(); + $classes[] = $this->get_class_from_file($filePath); + } + } + } + else{ + foreach ($controller as $index => $item) { + $filePath=$moduleDir . Config::get('url_controller_layer') . DS .$item.'.php'; $classes[] = $this->get_class_from_file($filePath); } } From fa088b18974f7833acb0ba12497a3c3a10c78e72 Mon Sep 17 00:00:00 2001 From: kingang <443721842@qq.com> Date: Thu, 2 Jan 2020 22:59:57 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=AF=E9=80=89api?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/command/Api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/command/Api.php b/application/admin/command/Api.php index c2ce2f2c..ed06302b 100644 --- a/application/admin/command/Api.php +++ b/application/admin/command/Api.php @@ -26,7 +26,7 @@ class Api extends Command ->addOption('author', 'a', Option::VALUE_OPTIONAL, 'document author', $site['name']) ->addOption('class', 'c', Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'extend class', null) ->addOption('language', 'l', Option::VALUE_OPTIONAL, 'language', 'zh-cn') - ->addOption('controller', 't', Option::VALUE_REQUIRED | Option::VALUE_IS_ARRAY, 'controller name', null) + ->addOption('controller', 'r', Option::VALUE_REQUIRED | Option::VALUE_IS_ARRAY, 'controller name', null) ->setDescription('Build Api document from controller'); } From eca3ae7086166f929352132001bcd5b260fe7836 Mon Sep 17 00:00:00 2001 From: Karson Date: Thu, 8 Oct 2020 22:51:06 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9C=A8=E9=9D=9E80?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E4=B8=8B=E7=9A=84=E8=B7=A8=E5=9F=9F=E5=88=A4?= =?UTF-8?q?=E6=96=AD=20=E4=BC=98=E5=8C=96=E5=AE=89=E8=A3=85=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/command/Install.php | 26 ++++++++++++++++---------- application/common.php | 2 +- application/config.php | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/application/admin/command/Install.php b/application/admin/command/Install.php index 82dd8c76..f7cd11af 100644 --- a/application/admin/command/Install.php +++ b/application/admin/command/Install.php @@ -199,19 +199,23 @@ class Install extends Command // 后台入口文件 $adminFile = ROOT_PATH . 'public' . DS . 'admin.php'; - // 生成数据库Env配置文件 - $envFile = ROOT_PATH . '.env.sample'; - $envStr = @file_get_contents($envFile); + // 数据库配置文件 + $dbConfigFile = APP_PATH . 'database.php'; + $config = @file_get_contents($dbConfigFile); $callback = function ($matches) use ($mysqlHostname, $mysqlHostport, $mysqlUsername, $mysqlPassword, $mysqlDatabase, $mysqlPrefix) { $field = "mysql" . ucfirst($matches[1]); $replace = $$field; - return "{$matches[1]} = {$replace}" . PHP_EOL; + if ($matches[1] == 'hostport' && $mysqlHostport == 3306) { + $replace = ''; + } + return "'{$matches[1]}'{$matches[2]}=>{$matches[3]}Env::get('database.{$matches[1]}', '{$replace}'),"; }; - $envConf = preg_replace_callback('/(hostname|database|username|password|hostport|prefix)\s*=\s*(.*?)\n/', $callback, $envStr); + $config = preg_replace_callback("/'(hostname|database|username|password|hostport|prefix)'(\s+)=>(\s+)Env::get\((.*)\)\,/", $callback, $config); - $result = @file_put_contents(ROOT_PATH . '.env', $envConf); + // 检测能否成功写入数据库配置 + $result = @file_put_contents($dbConfigFile, $config); if (!$result) { - throw new Exception(__('The current permissions are insufficient to write the file %s', '.env')); + throw new Exception(__('The current permissions are insufficient to write the file %s', 'application/database.php')); } // 变更默认管理员密码 @@ -275,15 +279,17 @@ class Install extends Command 'public' . DS . 'assets' . DS . 'libs' ]; + //数据库配置文件 + $dbConfigFile = APP_PATH . 'database.php'; + if (version_compare(PHP_VERSION, '7.0.0', '<')) { throw new Exception(__("The current version %s is too low, please use PHP 7.0 or higher", PHP_VERSION)); } if (!extension_loaded("PDO")) { throw new Exception(__("PDO is not currently installed and cannot be installed")); } - $envConfFile = ROOT_PATH . '.env'; - if (is_file($envConfFile) && !is_really_writable($envConfFile)) { - throw new Exception(__('The current permissions are insufficient to write the file %s', '.env')); + if (!is_really_writable($dbConfigFile)) { + throw new Exception(__('The current permissions are insufficient to write the configuration file application/database.php')); } foreach ($checkDirs as $k => $v) { if (!is_dir(ROOT_PATH . $v)) { diff --git a/application/common.php b/application/common.php index 351db242..3e6bbe5c 100755 --- a/application/common.php +++ b/application/common.php @@ -370,7 +370,7 @@ if (!function_exists('check_cors_request')) { if (isset($_SERVER['HTTP_ORIGIN']) && $_SERVER['HTTP_ORIGIN']) { $info = parse_url($_SERVER['HTTP_ORIGIN']); $domainArr = explode(',', config('fastadmin.cors_request_domain')); - $domainArr[] = request()->host(); + $domainArr[] = request()->host(true); if (in_array("*", $domainArr) || in_array($_SERVER['HTTP_ORIGIN'], $domainArr) || (isset($info['host']) && in_array($info['host'], $domainArr))) { header("Access-Control-Allow-Origin: " . $_SERVER['HTTP_ORIGIN']); } else { diff --git a/application/config.php b/application/config.php index 651de975..f1097771 100755 --- a/application/config.php +++ b/application/config.php @@ -290,7 +290,7 @@ return [ //允许跨域的域名,多个以,分隔 'cors_request_domain' => 'localhost,127.0.0.1', //版本号 - 'version' => '1.2.0.20201001_beta', + 'version' => '1.2.0.20201008_beta', //API接口地址 'api_url' => 'https://api.fastadmin.net', ], From fadcb5432a6c22b4aba90a9eabe6d87eabaf77e9 Mon Sep 17 00:00:00 2001 From: I'am EZ <123400558@qq.com> Date: Sun, 29 Nov 2020 04:50:56 +0800 Subject: [PATCH 05/12] update public/assets/js/frontend/user.js. --- public/assets/js/frontend/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/js/frontend/user.js b/public/assets/js/frontend/user.js index af8df6a3..81820813 100755 --- a/public/assets/js/frontend/user.js +++ b/public/assets/js/frontend/user.js @@ -58,7 +58,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und location.href = ret.url ? ret.url : "/"; }, 1000); }, function (data) { - $("input[name=captcha]").next(".input-group-addon").find("img").trigger("click"); + $("input[name=captcha]").next(".input-group-btn").find("img").trigger("click"); }); }, changepwd: function () { From 8d0384ee4914b29779d97defebdede7d3795ef3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=82=B2=E6=9D=B0=E7=AC=94=E8=AE=B0?= <1095143545@qq.com> Date: Thu, 3 Dec 2020 09:03:39 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E7=AE=80=E5=8D=95=E4=BF=AE=E5=A4=8Dselec?= =?UTF-8?q?tpage=20=E8=87=AA=E5=AE=9A=E4=B9=89data-primary-key=E4=B8=BA?= =?UTF-8?q?=E9=9D=9E=E6=95=B0=E5=80=BC=E5=9E=8B=E5=86=85=E5=AE=B9=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8E=92=E5=BA=8F=E5=AF=BC?= =?UTF-8?q?=E8=87=B4SQL=E6=8A=A5=E9=94=99BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/controller/Backend.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/application/common/controller/Backend.php b/application/common/controller/Backend.php index 4a240646..6e0798d6 100644 --- a/application/common/controller/Backend.php +++ b/application/common/controller/Backend.php @@ -539,6 +539,13 @@ class Backend extends Controller //如果有primaryvalue,说明当前是初始化传值,按照选择顺序排序 if ($primaryvalue !== null && preg_match("/^[a-z0-9_\-]+$/i", $primarykey)) { $primaryvalue = array_unique(is_array($primaryvalue) ? $primaryvalue : explode(',', $primaryvalue)); + //修复自定义data-primary-key为字符串内容时,给排序字段添加上引号 + $pk = $this->model->getPk(); + if ($primarykey != $pk) { + $primaryvalue= array_map(function ($value) { + return '\'' . $value . '\''; + }, $primaryvalue); + } $primaryvalue = implode(',', $primaryvalue); $this->model->orderRaw("FIELD(`{$primarykey}`, {$primaryvalue})"); From 9c13b07f738e7c5385eec17fa32ce708661b6051 Mon Sep 17 00:00:00 2001 From: cf king <466934322@qq.com> Date: Thu, 10 Dec 2020 17:43:56 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=BA=20ConfigModel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/general/Config.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/admin/controller/general/Config.php b/application/admin/controller/general/Config.php index f28040f6..1ceee2e6 100644 --- a/application/admin/controller/general/Config.php +++ b/application/admin/controller/general/Config.php @@ -28,7 +28,8 @@ class Config extends Backend public function _initialize() { parent::_initialize(); - $this->model = model('Config'); + // $this->model = model('Config'); + $this->model = new ConfigModel; ConfigModel::event('before_write', function ($row) { if (isset($row['name']) && $row['name'] == 'name' && preg_match("/fast" . "admin/i", $row['value'])) { throw new Exception(__("Site name incorrect")); From 2a131ae573e11c474bf09b5ea212e6b129846a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=82=B2=E6=9D=B0=E7=AC=94=E8=AE=B0?= <1095143545@qq.com> Date: Sat, 19 Dec 2020 11:18:07 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89data-primary-key=E4=B8=BA=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=97=B6=E6=8E=92=E5=BA=8F=E6=8A=A5=E9=94=99?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/controller/Backend.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/application/common/controller/Backend.php b/application/common/controller/Backend.php index 6e0798d6..e318a6a3 100644 --- a/application/common/controller/Backend.php +++ b/application/common/controller/Backend.php @@ -540,12 +540,10 @@ class Backend extends Controller if ($primaryvalue !== null && preg_match("/^[a-z0-9_\-]+$/i", $primarykey)) { $primaryvalue = array_unique(is_array($primaryvalue) ? $primaryvalue : explode(',', $primaryvalue)); //修复自定义data-primary-key为字符串内容时,给排序字段添加上引号 - $pk = $this->model->getPk(); - if ($primarykey != $pk) { - $primaryvalue= array_map(function ($value) { - return '\'' . $value . '\''; - }, $primaryvalue); - } + $primaryvalue= array_map(function ($value) { + return '\'' . $value . '\''; + }, $primaryvalue); + $primaryvalue = implode(',', $primaryvalue); $this->model->orderRaw("FIELD(`{$primarykey}`, {$primaryvalue})"); From 00bca5e0c84d40d6695841b82ad6e4a01ca0a851 Mon Sep 17 00:00:00 2001 From: Chrisleung Date: Fri, 8 Jan 2021 11:39:24 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcal=5Fdays=5Fin=5Fmonth?= =?UTF-8?q?=E7=9A=84month=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF,=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E8=AE=A1=E7=AE=97=E8=B7=A8=E5=B9=B4=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=88=B3=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/fast/Date.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extend/fast/Date.php b/extend/fast/Date.php index 8671476d..d8f7ab46 100644 --- a/extend/fast/Date.php +++ b/extend/fast/Date.php @@ -183,12 +183,14 @@ class Date mktime(23, 59, 59, $month, $day - date("w", mktime(0, 0, 0, $month, $day, $year)) + 7 - 7 * (-$offset), $year); break; case 'month': - $time = $position ? mktime(0, 0, 0, $month + $offset, 1, $year) : mktime(23, 59, 59, $month + $offset, cal_days_in_month(CAL_GREGORIAN, $month + $offset, $year), $year); + $_timestamp=mktime(0, 0, 0, $month + $offset, 1, $year); + $time = $position ? $_timestamp : mktime(23, 59, 59, $month + $offset, cal_days_in_month(CAL_GREGORIAN, date("m",$_timestamp), date("Y",$_timestamp)), $year); break; case 'quarter': + $_month=date("m",mktime(0, 0, 0, (ceil(date('n', mktime(0, 0, 0, $month, $day, $year)) / 3) + $offset) * 3, $day, $year)); $time = $position ? mktime(0, 0, 0, 1 + ((ceil(date('n', mktime(0, 0, 0, $month, $day, $year)) / 3) + $offset) - 1) * 3, 1, $year) : - mktime(23, 59, 59, (ceil(date('n', mktime(0, 0, 0, $month, $day, $year)) / 3) + $offset) * 3, cal_days_in_month(CAL_GREGORIAN, (ceil(date('n', mktime(0, 0, 0, $month, $day, $year)) / 3) + $offset) * 3, $year), $year); + mktime(23, 59, 59, (ceil(date('n', mktime(0, 0, 0, $month, $day, $year)) / 3) + $offset) * 3, cal_days_in_month(CAL_GREGORIAN, $_month, $year), $year); break; case 'year': $time = $position ? mktime(0, 0, 0, 1, 1, $year + $offset) : mktime(23, 59, 59, 12, 31, $year + $offset); From 700184c8eb14622e94cc13bfa9d3ad1f0b3d0ce1 Mon Sep 17 00:00:00 2001 From: Karson Date: Mon, 25 Jan 2021 21:04:13 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/command/Install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/command/Install.php b/application/admin/command/Install.php index ae3da35a..f9da2cd7 100644 --- a/application/admin/command/Install.php +++ b/application/admin/command/Install.php @@ -210,7 +210,7 @@ class Install extends Command } return "'{$matches[1]}'{$matches[2]}=>{$matches[3]}Env::get('database.{$matches[1]}', '{$replace}'),"; }; - $dbConfigText = preg_replace_callback("/'(hostname|database|username|password|hostport|prefix)'(\s+)=>(\s+)Env::get\((.*)\)\,/", $callback, $config); + $dbConfigText = preg_replace_callback("/'(hostname|database|username|password|hostport|prefix)'(\s+)=>(\s+)Env::get\((.*)\)\,/", $callback, $dbConfigText); // 检测能否成功写入数据库配置 $result = @file_put_contents($dbConfigFile, $dbConfigText); From 76b31ced9393e23d86d31954599a093548807a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=8D=8A?= <1094963513@qq.com> Date: Wed, 27 Jan 2021 04:36:37 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=97=B6Log=E7=B1=BB=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E7=9A=84=E8=87=B4=E5=91=BD=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/library/Email.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/common/library/Email.php b/application/common/library/Email.php index bad0fc1c..8d186fc3 100644 --- a/application/common/library/Email.php +++ b/application/common/library/Email.php @@ -62,7 +62,7 @@ class Email $secureArr = [0 => '', 1 => 'tls', 2 => 'ssl']; $secure = isset($secureArr[$this->options['mail_verify_type']]) ? $secureArr[$this->options['mail_verify_type']] : ''; - $this->mail = new Mailer(new Log); + $this->mail = new Mailer(); $this->mail->setServer($this->options['mail_smtp_host'], $this->options['mail_smtp_port'], $secure); $this->mail->setAuth($this->options['mail_from'], $this->options['mail_smtp_pass']); From 1fc50ed06d1af2724b0836831e0c8c0d303c241c Mon Sep 17 00:00:00 2001 From: F4NNIU Date: Tue, 2 Feb 2021 15:27:41 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=88=86=E9=9A=94=E7=BC=BA=E5=B0=91=20value=20=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/js/require-backend.min.js | 2 +- public/assets/js/require-frontend.min.js | 2 +- public/assets/js/require-table.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/assets/js/require-backend.min.js b/public/assets/js/require-backend.min.js index 9d10808a..986d351b 100644 --- a/public/assets/js/require-backend.min.js +++ b/public/assets/js/require-backend.min.js @@ -12130,7 +12130,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr 'click .img-center': function (e, value, row, index) { var data = []; value = value === null ? '' : value.toString(); - var arr = value != '' ? split(",") : []; + var arr = value != '' ? value.split(",") : []; $.each(arr, function (index, value) { data.push({ src: Fast.api.cdnurl(value), diff --git a/public/assets/js/require-frontend.min.js b/public/assets/js/require-frontend.min.js index 548028bb..1d975775 100644 --- a/public/assets/js/require-frontend.min.js +++ b/public/assets/js/require-frontend.min.js @@ -11979,7 +11979,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr 'click .img-center': function (e, value, row, index) { var data = []; value = value === null ? '' : value.toString(); - var arr = value != '' ? split(",") : []; + var arr = value != '' ? value.split(",") : []; $.each(arr, function (index, value) { data.push({ src: Fast.api.cdnurl(value), diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js index a1744d98..98244086 100644 --- a/public/assets/js/require-table.js +++ b/public/assets/js/require-table.js @@ -602,7 +602,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table 'click .img-center': function (e, value, row, index) { var data = []; value = value === null ? '' : value.toString(); - var arr = value != '' ? split(",") : []; + var arr = value != '' ? value.split(",") : []; $.each(arr, function (index, value) { data.push({ src: Fast.api.cdnurl(value),