diff --git a/niucloud/app/install/controller/Index.php b/niucloud/app/install/controller/Index.php index 6c1195e19..a5170fd1c 100644 --- a/niucloud/app/install/controller/Index.php +++ b/niucloud/app/install/controller/Index.php @@ -57,14 +57,14 @@ class Index extends BaseInstall $dirs_list = [ [ "path" => $root_path . DIRECTORY_SEPARATOR . ".env", "path_name" => "niucloud/.env", "name" => "env" ], [ "path" => $root_path . DIRECTORY_SEPARATOR . ".example.env", "path_name" => "niucloud/.example_env", "name" => "env" ], - [ "path" => $root_path . DIRECTORY_SEPARATOR . 'runtime/', "path_name" => "niucloud/runtime", "name" => "runtime" ], - [ "path" => $root_path . DIRECTORY_SEPARATOR . 'public/upload/', "path_name" => "niucloud/public/upload", "name" => "upload" ], - [ "path" => $root_path . DIRECTORY_SEPARATOR . 'app/install/', "path_name" => "niucloud/app/install", "name" => "安装目录" ] + [ "path" => $root_path . DIRECTORY_SEPARATOR . 'runtime'.DIRECTORY_SEPARATOR, "path_name" => "niucloud/runtime", "name" => "runtime" ], + [ "path" => $root_path . DIRECTORY_SEPARATOR . 'public'.DIRECTORY_SEPARATOR.'upload'.DIRECTORY_SEPARATOR, "path_name" => "niucloud/public/upload", "name" => "upload" ], + [ "path" => $root_path . DIRECTORY_SEPARATOR . 'app'.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR, "path_name" => "niucloud/app/install", "name" => "安装目录" ] ]; //目录 可读 可写检测 $is_dir = true; foreach ($dirs_list as $k => $v) { - !is_dir($v[ "path" ]) && mkdirs($v[ "path" ], 0755, true); + @mkdir($v[ "path" ], 0755, true); $is_readable = is_readable($v[ "path" ]); $is_write = is_write($v[ "path" ]); $dirs_list[ $k ][ "is_readable" ] = $is_readable; diff --git a/niucloud/app/service/core/file/CoreUploadConfigService.php b/niucloud/app/service/core/file/CoreUploadConfigService.php index d190056e0..10ba5bfd7 100644 --- a/niucloud/app/service/core/file/CoreUploadConfigService.php +++ b/niucloud/app/service/core/file/CoreUploadConfigService.php @@ -35,10 +35,18 @@ class CoreUploadConfigService extends BaseCoreService $info = (new CoreConfigService())->getConfig($site_id, ConfigKeyEnum::UPLOAD)['value'] ?? []; if (empty($info)) { $info = [ - 'image_ext' => '',//图片上传文件后缀 - 'video_ext' => '',//视频上传文件后缀 + 'image_ext' => [ + 'jpg', 'png', 'gif', 'jpeg', 'webp' + ],//图片上传文件后缀 + 'video_ext' => [ + 'wmv', 'avi', 'mpg', 'mpeg', '3gp', 'mov', 'mp4', 'flv', 'f4v', 'rmvb', 'mkv' + ],//视频上传文件后缀 + 'document_ext' => [ + 'crt', 'pem' + ], 'image_size' => 0,//图片上传大小限制 'video_size' => 0,//视频上传大小限制 + 'document_size' => 0,//文件上传大小限制 ]; } return $info; diff --git a/niucloud/app/service/core/file/CoreUploadService.php b/niucloud/app/service/core/file/CoreUploadService.php index 2693b8794..bfd41eef6 100644 --- a/niucloud/app/service/core/file/CoreUploadService.php +++ b/niucloud/app/service/core/file/CoreUploadService.php @@ -119,11 +119,13 @@ class CoreUploadService extends CoreFileService $config['file_ext'] = match ($att_type) { FileEnum::IMAGE => $config['image_ext'] ?? [], FileEnum::VIDEO => $config['video_ext'] ?? [], + FileEnum::DOCUMENT => $config['document_ext'] ?? [], default => [], }; $config['file_size'] = match ($att_type) { FileEnum::IMAGE => $config['image_size'] ?? 0, FileEnum::VIDEO => $config['video_size'] ?? 0, + FileEnum::DOCUMENT => $config['document_size'] ?? [], default => 0, }; $rule = []; diff --git a/niucloud/public/.gitignore b/niucloud/public/.gitignore index 8b0144799..e7a89feb3 100644 --- a/niucloud/public/.gitignore +++ b/niucloud/public/.gitignore @@ -1,4 +1,3 @@ /.htaccess -upload nginx.htaccess .htaccess \ No newline at end of file diff --git a/niucloud/public/upload/.gitignore b/niucloud/public/upload/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/uni-app/pages/article/detail.vue b/uni-app/pages/article/detail.vue index 5820adf20..f428d9ded 100644 --- a/uni-app/pages/article/detail.vue +++ b/uni-app/pages/article/detail.vue @@ -27,7 +27,6 @@ import { t } from '@/locale' import { getArticleDetail } from '@/api/article'; import { useShare } from '@/hooks/useShare' - import { currShareRoute } from '@/utils/common'; const { setShare, onShareAppMessage, onShareTimeline } = useShare() onShareAppMessage()