Commit 0a5c03a5 authored by 王源's avatar 王源
Browse files

修改上传文件临时目录判断逻辑

parent 92b4c105
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -172,8 +172,8 @@ class UploadManager
     */
    public static function parsePath($options, $documentRoot)
    {
        if (isset($options['temp']) && $options['temp'] && !isset($options['path'])) {
            // 如果是临时文件,且没有指定保存路径,修改保存路径为临时路径
        if (isset($options['temp']) && $options['temp']) {
            // 如果是临时文件,修改保存路径为临时路径
            $options['path'] = 'temp';
        }
        $path = $documentRoot . self::$pathPrefix . $options['path'] . '/' . date('Y-m-d');
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ class ExcelImporter
        $this->config = container(ConfigInterface::class);
        $this->fileType = ucfirst($file->getExtension());
        $this->rootPath = $this->config->get('server.settings.document_root', BASE_PATH . '/public');
        $path = UploadManager::uploadExcelGetRealPath($file);
        $path = UploadManager::uploadExcelGetRealPath($file, ['temp' => true]);
        $this->reader = IOFactory::createReaderForFile($path)->load($path);
        $this->filePath = $path;
        $this->sheet = $this->reader->getSheet($sheetIndex);