From 52ce17a0b7b6831d3c0b9ca61671e0a092beaa7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Mon, 17 Apr 2017 18:47:56 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E5=A4=8D=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0=E5=BC=95=E6=93=8E=E9=80=89=E7=94=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Plugs.php | 6 +++++- public/static/admin/listen.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/application/admin/controller/Plugs.php b/application/admin/controller/Plugs.php index b6e5a90be..76eff75a6 100644 --- a/application/admin/controller/Plugs.php +++ b/application/admin/controller/Plugs.php @@ -47,7 +47,11 @@ class Plugs extends BasicAdmin { $types = $this->request->get('type', 'jpg,png'); $this->assign('mode', $mode); $this->assign('types', $types); - $this->assign('uptype', $this->request->get('uptype', sysconf('storage_type'))); + $uptype = $this->request->get('uptype'); + if (!in_array($uptype, ['local', 'qiniu'])) { + $uptype = sysconf('storage_type'); + } + $this->assign('uptype', $uptype); $this->assign('mimes', FileService::getFileMine($types)); $this->assign('field', $this->request->get('field', 'file')); return view(); diff --git a/public/static/admin/listen.js b/public/static/admin/listen.js index 1090ebd2b..3eee62764 100644 --- a/public/static/admin/listen.js +++ b/public/static/admin/listen.js @@ -101,7 +101,7 @@ define(['jquery', 'admin.plugs'], function () { var field = $(this).attr('data-field') || 'file'; var method = $(this).attr('data-file') === 'one' ? 'one' : 'mtl'; var title = $(this).attr('data-title') || '文件上传'; - var uptype = $(this).attr('data-uptype') || 'local'; + var uptype = $(this).attr('data-uptype') || ''; var url = window.ROOT_URL + '/index.php/admin/plugs/upfile/mode/' + method + '.html?uptype=' + uptype + '&type=' + type + '&field=' + field; $.form.iframe(url, title || '文件管理'); });