作者 lyh

gx

... ... @@ -37,6 +37,7 @@ class FileController
public $image_type = [
1 => 'file_other',
0 => 'file'
];
public function __construct()
{
... ... @@ -174,7 +175,7 @@ class FileController
'size' => $res->getSize(),
'hash' => $hash,
'type'=>$files->getClientOriginalExtension(),
'refer'=>$this->param['refer']
'refer'=>$this->param['refer'] ?? 0
];
$rs = $fileModel->add($data);
if ($rs === false) {
... ...
... ... @@ -179,7 +179,7 @@ class ImageController extends Controller
*/
private function cacheImage($info, $w, $h) {
$path = $info['path'];
$filename = $this->config['url'] . '/' . $info['path'] . '_' . $w . '_' . $h;
$filename = $this->config['root'] . '/' . $info['path'] . '_' . $w . '_' . $h;
Image::make($path)->resize($w, $h)->save($filename);
return $filename;
}
... ... @@ -193,7 +193,6 @@ class ImageController extends Controller
* @time :2023/6/17 16:31
*/
private function multi($files) {
if (!is_array($files)) {
$files = [$files];
}
... ...