修改原有框架中英文映射

This commit is contained in:
2026-03-17 18:09:10 +08:00
parent e7b8f4cae9
commit bdf50e61f5
81 changed files with 1956 additions and 735 deletions

View File

@@ -34,17 +34,17 @@ class UploadService
$ext = $file->getUploadExtension() ?: null;
$file_size = $file->getSize();
if ($file_size > Arr::getConfigValue($uploadConfig, 'upload_size')) {
throw new ApiException('文件大小超过限制');
throw new ApiException('File size exceeds limit');
}
$allow_file = Arr::getConfigValue($uploadConfig, 'upload_allow_file');
$allow_image = Arr::getConfigValue($uploadConfig, 'upload_allow_image');
if ($upload == 'image') {
if (!in_array($ext, explode(',', $allow_image))) {
throw new ApiException('不支持该格式的文件上传');
throw new ApiException('File format not supported for upload');
}
} else {
if (!in_array($ext, explode(',', $allow_file))) {
throw new ApiException('不支持该格式的文件上传');
throw new ApiException('File format not supported for upload');
}
}
switch ($type) {
@@ -115,7 +115,7 @@ class UploadService
];
break;
default:
throw new ApiException('该上传模式不存在');
throw new ApiException('Upload mode not found');
}
return new $config['adapter'](array_merge(
$config,