From 58c72de604eeee1f9ce0edb4fb35ee4669e2c165 Mon Sep 17 00:00:00 2001
From: Karson <karsonzhang@163.com>
Date: Sat, 7 Apr 2018 22:26:00 +0800
Subject: [PATCH] 修复插件配置丢失的BUG 修复后台登录验证码在admin.php下无法显示的BUG 修复templateView下筛选框无法点击的BUG

---
 application/admin/controller/Addon.php  | 7 ++++++-
 application/admin/view/index/login.html | 2 +-
 public/assets/js/require-backend.min.js | 4 ++--
 public/assets/js/require-table.js       | 4 ++--
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php
index 959d585..f3f5f24 100644
--- a/application/admin/controller/Addon.php
+++ b/application/admin/controller/Addon.php
@@ -61,7 +61,12 @@ class Addon extends Backend
             if ($params) {
                 foreach ($config as $k => &$v) {
                     if (isset($params[$v['name']])) {
-                        $value = is_array($params[$v['name']]) ? implode(',', $params[$v['name']]) : $params[$v['name']];
+                        if ($v['type'] == 'array') {
+                            $params[$v['name']] = is_array($params[$v['name']]) ? $params[$v['name']] : (array)json_decode($params[$v['name']], true);
+                            $value = $params[$v['name']];
+                        } else {
+                            $value = is_array($params[$v['name']]) ? implode(',', $params[$v['name']]) : $params[$v['name']];
+                        }
                         $v['value'] = $value;
                     }
                 }
diff --git a/application/admin/view/index/login.html b/application/admin/view/index/login.html
index 57f3992..439dec8 100644
--- a/application/admin/view/index/login.html
+++ b/application/admin/view/index/login.html
@@ -81,7 +81,7 @@
                                     <div class="input-group-addon"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></div>
                                     <input type="text" name="captcha" class="form-control" placeholder="{:__('Captcha')}" data-rule="{:__('Captcha')}:required;length(4)" />
                                     <span class="input-group-addon" style="padding:0;border:none;cursor:pointer;">
-                                        <img src="{:captcha_src()}" width="100" height="30" onclick="this.src = '{:captcha_src()}?r=' + Math.random();"/>
+                                        <img src="{:rtrim('__PUBLIC__', '/')}/captcha" width="100" height="30" onclick="this.src = '{:rtrim('__PUBLIC__', '/')}/captcha?r=' + Math.random();"/>
                                     </span>
                                 </div>
                                 {/if}
diff --git a/public/assets/js/require-backend.min.js b/public/assets/js/require-backend.min.js
index 6ec1eb3..fb550ff 100644
--- a/public/assets/js/require-backend.min.js
+++ b/public/assets/js/require-backend.min.js
@@ -9565,7 +9565,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
                 });
                 $(table).on("click", "input[data-id][name='checkbox']", function (e) {
                     var ids = $(this).data("id");
-                    var row = Table.api.getrowbyid(ids);
+                    var row = Table.api.getrowbyid(table, ids);
                     table.trigger('check.bs.table', [row, this]);
                 });
                 $(table).on("click", "[data-id].btn-change", function (e) {
@@ -9575,7 +9575,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
                 $(table).on("click", "[data-id].btn-edit", function (e) {
                     e.preventDefault();
                     var ids = $(this).data("id");
-                    var row = Table.api.getrowbyid(ids);
+                    var row = Table.api.getrowbyid(table, ids);
                     row.ids = ids;
                     var url = Table.api.replaceurl(options.extend.edit_url, row, table);
                     Fast.api.open(url, __('Edit'), $(this).data() || {});
diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js
index 6fec4c0..eb5013e 100644
--- a/public/assets/js/require-table.js
+++ b/public/assets/js/require-table.js
@@ -261,7 +261,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                 });
                 $(table).on("click", "input[data-id][name='checkbox']", function (e) {
                     var ids = $(this).data("id");
-                    var row = Table.api.getrowbyid(ids);
+                    var row = Table.api.getrowbyid(table, ids);
                     table.trigger('check.bs.table', [row, this]);
                 });
                 $(table).on("click", "[data-id].btn-change", function (e) {
@@ -271,7 +271,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                 $(table).on("click", "[data-id].btn-edit", function (e) {
                     e.preventDefault();
                     var ids = $(this).data("id");
-                    var row = Table.api.getrowbyid(ids);
+                    var row = Table.api.getrowbyid(table, ids);
                     row.ids = ids;
                     var url = Table.api.replaceurl(options.extend.edit_url, row, table);
                     Fast.api.open(url, __('Edit'), $(this).data() || {});
--
libgit2 0.24.0