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')}