From ed0da37370d2209cadd2a00a676573838eedcf88 Mon Sep 17 00:00:00 2001 From: Karson Date: Fri, 4 Jun 2021 14:49:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=99=84=E4=BB=B6=E5=BD=92?= =?UTF-8?q?=E7=B1=BB=E6=96=87=E5=AD=97=E5=92=8C=E6=9D=83=E9=99=90=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/general/Attachment.php | 9 +++++++-- application/admin/lang/zh-cn/general/attachment.php | 1 + application/admin/view/general/attachment/index.html | 2 +- public/assets/js/backend/general/attachment.js | 9 +++++---- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/application/admin/controller/general/Attachment.php b/application/admin/controller/general/Attachment.php index 57296f2f..2963a099 100644 --- a/application/admin/controller/general/Attachment.php +++ b/application/admin/controller/general/Attachment.php @@ -19,6 +19,7 @@ class Attachment extends Backend protected $model = null; protected $searchFields = 'id,filename,url'; + protected $noNeedRight = ['classify']; public function _initialize() { @@ -132,10 +133,14 @@ class Attachment extends Backend } /** - * 移动 + * 归类 */ - public function move($ids = "") + public function classify() { + if (!$this->auth->check('general/attachment/edit')) { + \think\Hook::listen('admin_nopermission', $this); + $this->error(__('You have no permission'), ''); + } if (!$this->request->isPost()) { $this->error(__("Invalid parameters")); } diff --git a/application/admin/lang/zh-cn/general/attachment.php b/application/admin/lang/zh-cn/general/attachment.php index 86690e2a..afcf06f3 100644 --- a/application/admin/lang/zh-cn/general/attachment.php +++ b/application/admin/lang/zh-cn/general/attachment.php @@ -28,6 +28,7 @@ return [ 'Custom' => '自定义', 'Unclassed' => '未归类', 'Category' => '类别', + 'Classify' => '归类', 'Upload to third' => '上传到第三方', 'Upload to local' => '上传到本地', 'Upload to third by chunk' => '上传到第三方(分片模式)', diff --git a/application/admin/view/general/attachment/index.html b/application/admin/view/general/attachment/index.html index 8aaf0435..7272d758 100644 --- a/application/admin/view/general/attachment/index.html +++ b/application/admin/view/general/attachment/index.html @@ -16,7 +16,7 @@
{:build_toolbar('refresh,add,edit,del')} - {:__('Move')} + {:__('Classify')}