From 73cbd8524339c0adf5619a04218bf3071d32b0c5 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Tue, 14 Apr 2020 15:13:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/admin/controller/setting/SystemConfig.php | 2 +- crmeb/app/admin/controller/widget/Images.php | 3 ++- crmeb/app/api/controller/user/UserBillController.php | 2 +- crmeb/crmeb/services/UploadService.php | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crmeb/app/admin/controller/setting/SystemConfig.php b/crmeb/app/admin/controller/setting/SystemConfig.php index 75b4ed02..8fdcd19c 100644 --- a/crmeb/app/admin/controller/setting/SystemConfig.php +++ b/crmeb/app/admin/controller/setting/SystemConfig.php @@ -400,7 +400,7 @@ class SystemConfig extends AuthController * 文件上传 * */ public function file_upload(){ - $res = Upload::instance()->setUploadPath('config/file')->file($this->request->param('file','file')); + $res = Upload::instance()->setAutoValidate(true)->setUploadPath('config/file')->file($this->request->param('file','file')); if(!$res->status) return Json::fail($res->error); return Json::successful('上传成功!',['filePath'=>$res->filePath]); } diff --git a/crmeb/app/admin/controller/widget/Images.php b/crmeb/app/admin/controller/widget/Images.php index 8c7ae19a..bdc1db9d 100644 --- a/crmeb/app/admin/controller/widget/Images.php +++ b/crmeb/app/admin/controller/widget/Images.php @@ -123,8 +123,9 @@ class Images extends AuthController * @param $att_id */ public function deleteimganddata($att_id){ - $attinfo = SystemAttachmentModel::get($att_id)->toArray(); + $attinfo = SystemAttachmentModel::get($att_id); if($attinfo){ + $attinfo = $attinfo->toArray(); if($attinfo['image_type'] == 1){ @unlink(app()->getRootPath().ltrim($attinfo['att_dir'],'.')); @unlink(app()->getRootPath().ltrim($attinfo['satt_dir'],'.')); diff --git a/crmeb/app/api/controller/user/UserBillController.php b/crmeb/app/api/controller/user/UserBillController.php index 17401108..afea3255 100644 --- a/crmeb/app/api/controller/user/UserBillController.php +++ b/crmeb/app/api/controller/user/UserBillController.php @@ -247,7 +247,7 @@ class UserBillController $urlCode = $imageInfo['dir']; } else $urlCode = $imageInfo['att_dir']; if ($imageInfo['image_type'] == 1) $urlCode = $siteUrl . $urlCode; - $siteUrl = UtilService::setHttpType($siteUrl, 1); + $siteUrl = UtilService::setHttpType($siteUrl, $request->isSsl() ? 0 : 1); $filelink = [ 'Bold' => 'static' . DS . 'font' . DS . 'Alibaba-PuHuiTi-Regular.otf', 'Normal' => 'static' . DS . 'font' . DS . 'Alibaba-PuHuiTi-Regular.otf', diff --git a/crmeb/crmeb/services/UploadService.php b/crmeb/crmeb/services/UploadService.php index 58bdcfc5..a09d2479 100644 --- a/crmeb/crmeb/services/UploadService.php +++ b/crmeb/crmeb/services/UploadService.php @@ -378,7 +378,7 @@ class UploadService protected function setUploadInfo(string $url, int $imageType, string $name = '', string $thumbPath = '', array $headerArray = []) { $headerArray = count($headerArray) ? $headerArray : self::getImageHeaders($url); - if (is_array($headerArray['Content-Type']) && count($headerArray['Content-Length']) == 2) { + if (is_array($headerArray['Content-Length']) && count($headerArray['Content-Length']) == 2) { $headerArray['Content-Length'] = $headerArray['Content-Length'][1]; } if (is_array($headerArray['Content-Type']) && count($headerArray['Content-Type']) == 2) {