wupengfei 2 年之前
父節點
當前提交
4aaf9c0a70
共有 1 個文件被更改,包括 1 次插入1 次删除
  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($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 {