diff --git a/app/admin/controller/api/Upload.php b/app/admin/controller/api/Upload.php index 288aa4866..4217a7f0d 100644 --- a/app/admin/controller/api/Upload.php +++ b/app/admin/controller/api/Upload.php @@ -65,8 +65,7 @@ class Upload extends Controller if (in_array($this->extension, ['php', 'sh'])) { return json(['uploaded' => false, 'error' => ['message' => '可执行文件禁止上传到本地服务器']]); } - $this->safe = boolval(input('safe')); - $this->uptype = $this->getType(); + list($this->safe, $this->uptype) = [boolval(input('safe')), $this->getType()]; $name = Storage::name($file->getPathname(), $this->extension, '', 'md5_file'); $info = Storage::instance($this->uptype)->set($name, file_get_contents($file->getRealPath()), $this->safe); if (is_array($info) && isset($info['url'])) { diff --git a/build.cmd b/build.cmd index bfc3d5480..e131aa2a6 100644 --- a/build.cmd +++ b/build.cmd @@ -1,3 +1,2 @@ @echo off -@rmdir /s/q vendor composer update --profile --prefer-dist --no-dev --optimize-autoloader \ No newline at end of file diff --git a/composer.lock b/composer.lock index b71d0af2c..b7287f5bd 100644 --- a/composer.lock +++ b/composer.lock @@ -699,12 +699,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "18979c6d4fc36b65036b35a11180f30752659768" + "reference": "a8aec7398659c885312a59aff4b4eca1c9c48697" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/18979c6d4fc36b65036b35a11180f30752659768", - "reference": "18979c6d4fc36b65036b35a11180f30752659768", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/a8aec7398659c885312a59aff4b4eca1c9c48697", + "reference": "a8aec7398659c885312a59aff4b4eca1c9c48697", "shasum": "" }, "require": { @@ -742,7 +742,7 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://framework.thinkadmin.top", - "time": "2019-11-21T02:42:19+00:00" + "time": "2019-11-21T03:18:49+00:00" } ], "packages-dev": [], diff --git a/vendor/autoload.php b/vendor/autoload.php index a13d47ca9..4ac0e9b5a 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitc95e9bc2afd6956f8345526ebec125c0::getLoader(); +return ComposerAutoloaderInit41e48da7c236026fbb8265abc69af9d9::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 257ab1687..632e6ed2c 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitc95e9bc2afd6956f8345526ebec125c0 +class ComposerAutoloaderInit41e48da7c236026fbb8265abc69af9d9 { private static $loader; @@ -19,15 +19,15 @@ class ComposerAutoloaderInitc95e9bc2afd6956f8345526ebec125c0 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitc95e9bc2afd6956f8345526ebec125c0', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit41e48da7c236026fbb8265abc69af9d9', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInitc95e9bc2afd6956f8345526ebec125c0', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit41e48da7c236026fbb8265abc69af9d9', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitc95e9bc2afd6956f8345526ebec125c0::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit41e48da7c236026fbb8265abc69af9d9::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -48,19 +48,19 @@ class ComposerAutoloaderInitc95e9bc2afd6956f8345526ebec125c0 $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInitc95e9bc2afd6956f8345526ebec125c0::$files; + $includeFiles = Composer\Autoload\ComposerStaticInit41e48da7c236026fbb8265abc69af9d9::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequirec95e9bc2afd6956f8345526ebec125c0($fileIdentifier, $file); + composerRequire41e48da7c236026fbb8265abc69af9d9($fileIdentifier, $file); } return $loader; } } -function composerRequirec95e9bc2afd6956f8345526ebec125c0($fileIdentifier, $file) +function composerRequire41e48da7c236026fbb8265abc69af9d9($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index a35f77d97..b5bb57cea 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitc95e9bc2afd6956f8345526ebec125c0 +class ComposerStaticInit41e48da7c236026fbb8265abc69af9d9 { public static $files = array ( '9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php', @@ -471,9 +471,9 @@ class ComposerStaticInitc95e9bc2afd6956f8345526ebec125c0 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitc95e9bc2afd6956f8345526ebec125c0::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitc95e9bc2afd6956f8345526ebec125c0::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitc95e9bc2afd6956f8345526ebec125c0::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit41e48da7c236026fbb8265abc69af9d9::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit41e48da7c236026fbb8265abc69af9d9::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit41e48da7c236026fbb8265abc69af9d9::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index d5f1c7516..100e3b7c6 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -721,12 +721,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "18979c6d4fc36b65036b35a11180f30752659768" + "reference": "a8aec7398659c885312a59aff4b4eca1c9c48697" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/18979c6d4fc36b65036b35a11180f30752659768", - "reference": "18979c6d4fc36b65036b35a11180f30752659768", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/a8aec7398659c885312a59aff4b4eca1c9c48697", + "reference": "a8aec7398659c885312a59aff4b4eca1c9c48697", "shasum": "" }, "require": { @@ -736,7 +736,7 @@ "ext-json": "*", "topthink/framework": "^6.0" }, - "time": "2019-11-21T02:42:19+00:00", + "time": "2019-11-21T03:18:49+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index 3be102f05..72d9cab92 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service', diff --git a/vendor/zoujingli/think-library/src/storage/LocalStorage.php b/vendor/zoujingli/think-library/src/storage/LocalStorage.php index 148a68d73..1ebcd3c4d 100644 --- a/vendor/zoujingli/think-library/src/storage/LocalStorage.php +++ b/vendor/zoujingli/think-library/src/storage/LocalStorage.php @@ -135,7 +135,7 @@ class LocalStorage extends Storage */ public function upload() { - return url('@')->build() . '?s=admin/upload/file'; + return url('@')->build() . '?s=admin/api.upload/file'; } } \ No newline at end of file