wupengfei 2 years ago
parent
commit
ec5f6c836c
1 changed files with 1 additions and 1 deletions
  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('image'.$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 {