liaofei 5 vuotta sitten
vanhempi
commit
73cbd85243

+ 1 - 1
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]);
    }

+ 2 - 1
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'],'.'));

+ 1 - 1
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',

+ 1 - 1
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) {