wupengfei 2 gadi atpakaļ
vecāks
revīzija
8cda92b0d6
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      application/admin/controller/api/Plugs.php

+ 1 - 1
application/admin/controller/api/Plugs.php

@@ -76,7 +76,7 @@ class Plugs extends Controller
         $this->uptype = $this->getUploadType();
         $this->extend = pathinfo($file->getInfo('name'), PATHINFO_EXTENSION);
         $name = File::name($file->getPathname(), $this->extend, '', 'md5_file');
-        $info = File::instance($this->uptype)->save($name, file_get_contents($file->getRealPath()), $this->safe);
+        $info = File::instance($this->uptype)->save('image'.$name, file_get_contents($file->getRealPath()), $this->safe);
         if (is_array($info) && isset($info['url'])) {
             return json(['uploaded' => true, 'filename' => $name, 'url' => $this->safe ? $name : $info['url']]);
         } else {