From 58edcba99551a2eac9d4f5c34ea23be5a0ef2dea Mon Sep 17 00:00:00 2001 From: Karson Date: Wed, 31 May 2017 09:51:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=99=84=E4=BB=B6=E5=8C=BA?= =?UTF-8?q?=E5=88=86=E6=9C=AC=E5=9C=B0=E6=88=96=E8=BF=9C=E7=A8=8B=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=20=E6=96=B0=E5=A2=9EBackend.api.cdnurl=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=94=A8=E4=BA=8E=E8=8E=B7=E5=8F=96=E8=B5=84=E6=BA=90?= =?UTF-8?q?cdn=E7=9A=84=E5=9C=B0=E5=9D=80=20=E4=BF=AE=E5=A4=8D=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E5=88=97=E8=A1=A8=E5=9B=BE=E7=89=87=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84BUG=20=E4=BF=AE=E5=A4=8D=E8=BE=B9=E6=A0=8F=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E5=A4=A7=E5=B0=8F=E6=98=BE=E7=A4=BA=E7=9A=84BUG=20?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=90=AB=E6=9C=89password=E7=9A=84=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=20=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E8=B5=84=E6=96=99=E4=B8=AD=E6=98=BE=E7=A4=BA=E5=85=B6=E5=AE=83?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E6=97=A5=E5=BF=97=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Ajax.php | 1 + .../admin/controller/general/Attachment.php | 9 +++++++-- application/admin/controller/general/Profile.php | 2 ++ .../admin/lang/zh-cn/general/attachment.php | 3 ++- application/admin/model/AdminLog.php | 2 +- .../admin/view/example/bootstraptable/index.html | 2 +- .../admin/view/example/colorbadge/index.html | 2 +- .../admin/view/example/controllerjump/index.html | 2 +- application/admin/view/general/attachment/add.html | 12 +++++++++--- .../admin/view/general/attachment/edit.html | 6 ++++++ application/index/controller/Upyun.php | 3 ++- public/assets/css/backend.css | 5 ++--- public/assets/css/backend.min.css | 2 +- public/assets/js/backend.js | 4 ++++ public/assets/js/backend/general/attachment.js | 14 +++++--------- public/assets/js/backend/general/profile.js | 4 ++-- public/assets/js/backend/index.js | 2 +- public/assets/js/require-backend.min.js | 10 +++++++--- public/assets/js/require-form.js | 2 +- public/assets/js/require-table.js | 2 +- public/assets/js/require-upload.js | 2 +- public/assets/less/backend.less | 5 ++--- 22 files changed, 60 insertions(+), 36 deletions(-) diff --git a/application/admin/controller/Ajax.php b/application/admin/controller/Ajax.php index 9e90b543..4f30fafc 100644 --- a/application/admin/controller/Ajax.php +++ b/application/admin/controller/Ajax.php @@ -199,6 +199,7 @@ class Ajax extends Backend 'mimetype' => $fileInfo['type'], 'url' => $uploadDir . $splInfo->getSaveName(), 'uploadtime' => time(), + 'storage' => 'local', 'sha1' => $sha1, ); model("attachment")->create(array_filter($params)); diff --git a/application/admin/controller/general/Attachment.php b/application/admin/controller/general/Attachment.php index ec43292c..0207fe52 100644 --- a/application/admin/controller/general/Attachment.php +++ b/application/admin/controller/general/Attachment.php @@ -39,14 +39,19 @@ class Attachment extends Backend ->order($sort, $order) ->limit($offset, $limit) ->select(); - + $cdnurl = preg_replace("/\/(\w+)\.php$/i", '', $this->request->root()); + foreach ($list as $k => &$v) + { + $v['fullurl'] = ($v['storage'] == 'local' ? $cdnurl : $this->view->config['upload']['cdnurl']) . $v['url']; + } + unset($v); $result = array("total" => $total, "rows" => $list); return json($result); } return $this->view->fetch(); } - + /** * 选择附件 */ diff --git a/application/admin/controller/general/Profile.php b/application/admin/controller/general/Profile.php index 867a102e..39344b19 100644 --- a/application/admin/controller/general/Profile.php +++ b/application/admin/controller/general/Profile.php @@ -27,11 +27,13 @@ class Profile extends Backend $total = $model ->where($where) + ->where('admin_id', $this->auth->id) ->order($sort, $order) ->count(); $list = $model ->where($where) + ->where('admin_id', $this->auth->id) ->order($sort, $order) ->limit($offset, $limit) ->select(); diff --git a/application/admin/lang/zh-cn/general/attachment.php b/application/admin/lang/zh-cn/general/attachment.php index e35157b4..c49aeb3a 100644 --- a/application/admin/lang/zh-cn/general/attachment.php +++ b/application/admin/lang/zh-cn/general/attachment.php @@ -10,5 +10,6 @@ return [ 'Mimetype' => 'mime类型', 'Extparam' => '透传数据', 'Createtime' => '创建日期', - 'Uploadtime' => '上传时间' + 'Uploadtime' => '上传时间', + 'Storage' => '存储引擎' ]; diff --git a/application/admin/model/AdminLog.php b/application/admin/model/AdminLog.php index 698cb8a9..8177a233 100644 --- a/application/admin/model/AdminLog.php +++ b/application/admin/model/AdminLog.php @@ -21,7 +21,7 @@ class AdminLog extends Model $content = request()->param(); foreach ($content as $k => $v) { - if (is_string($v) && strlen($v) > 200) + if (is_string($v) && strlen($v) > 200 || stripos($k, 'password') !== false) { unset($content[$k]); } diff --git a/application/admin/view/example/bootstraptable/index.html b/application/admin/view/example/bootstraptable/index.html index 7cca0712..37333819 100644 --- a/application/admin/view/example/bootstraptable/index.html +++ b/application/admin/view/example/bootstraptable/index.html @@ -6,7 +6,7 @@
- {:build_toolbar('delete')} + {:build_toolbar('refresh,delete')}