优化图片上传

master
chenzhi 4 years ago
parent 537c496793
commit d5a8c97ad3

@ -202,10 +202,11 @@ class FileController extends AdminController
/* 调用文件上传组件上传文件 */
$Picture = D('Picture');
$pic_driver = C('PICTURE_UPLOAD_DRIVER');
// dd(I('icon'));
if (I('icon')) {
if ($_FILES['file']['size'] > 51200) {
$return = array('status' => 1001, 'info' => '图片大小不得超过50k', 'data' => '');
if ($_FILES['file']['size'] > 2097152) {
$return = array('status' => 1001, 'info' => '图片大小不得超过2M', 'data' => '');
$this->ajaxReturn($return);
}
}

@ -2586,7 +2586,7 @@
});
if (response.status==1001) {
alert('图片大小不得超过50k');
alert('图片大小不得超过2M');
$('#icon_thelist').children().last().remove();
location.reload()
}

Loading…
Cancel
Save