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