作者 lyh

gx

@@ -37,6 +37,7 @@ class FileController @@ -37,6 +37,7 @@ class FileController
37 37
38 public $image_type = [ 38 public $image_type = [
39 1 => 'file_other', 39 1 => 'file_other',
  40 + 0 => 'file'
40 ]; 41 ];
41 public function __construct() 42 public function __construct()
42 { 43 {
@@ -174,7 +175,7 @@ class FileController @@ -174,7 +175,7 @@ class FileController
174 'size' => $res->getSize(), 175 'size' => $res->getSize(),
175 'hash' => $hash, 176 'hash' => $hash,
176 'type'=>$files->getClientOriginalExtension(), 177 'type'=>$files->getClientOriginalExtension(),
177 - 'refer'=>$this->param['refer'] 178 + 'refer'=>$this->param['refer'] ?? 0
178 ]; 179 ];
179 $rs = $fileModel->add($data); 180 $rs = $fileModel->add($data);
180 if ($rs === false) { 181 if ($rs === false) {
@@ -179,7 +179,7 @@ class ImageController extends Controller @@ -179,7 +179,7 @@ class ImageController extends Controller
179 */ 179 */
180 private function cacheImage($info, $w, $h) { 180 private function cacheImage($info, $w, $h) {
181 $path = $info['path']; 181 $path = $info['path'];
182 - $filename = $this->config['url'] . '/' . $info['path'] . '_' . $w . '_' . $h; 182 + $filename = $this->config['root'] . '/' . $info['path'] . '_' . $w . '_' . $h;
183 Image::make($path)->resize($w, $h)->save($filename); 183 Image::make($path)->resize($w, $h)->save($filename);
184 return $filename; 184 return $filename;
185 } 185 }
@@ -193,7 +193,6 @@ class ImageController extends Controller @@ -193,7 +193,6 @@ class ImageController extends Controller
193 * @time :2023/6/17 16:31 193 * @time :2023/6/17 16:31
194 */ 194 */
195 private function multi($files) { 195 private function multi($files) {
196 -  
197 if (!is_array($files)) { 196 if (!is_array($files)) {
198 $files = [$files]; 197 $files = [$files];
199 } 198 }