修改原有框架中英文映射

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

@@ -54,7 +54,7 @@ class ChunkUploadService
{
$allow_file = Arr::getConfigValue($this->config, 'upload_allow_file');
if (!in_array($data['ext'], explode(',', $allow_file))) {
throw new ApiException('不支持该格式的文件上传');
throw new ApiException('File format not supported for upload');
}
// 检查已经上传的分片文件
for ($i = 0; $i < $data['total']; ++$i) {
@@ -80,11 +80,11 @@ class ChunkUploadService
{
$allow_file = Arr::getConfigValue($this->config, 'upload_allow_file');
if (!in_array($data['ext'], explode(',', $allow_file))) {
throw new ApiException('不支持该格式的文件上传');
throw new ApiException('File format not supported for upload');
}
$request = request();
if (!$request) {
throw new ApiException('切片上传服务必须在 HTTP 请求环境下调用');
throw new ApiException('Chunk upload must be called in HTTP request context');
}
$uploadFile = current($request->file());
$chunkName = $this->path . "{$data['hash']}_{$data['total']}_{$data['index']}.chunk";
@@ -107,7 +107,7 @@ class ChunkUploadService
for ($i = 0; $i < $data['total']; ++$i) {
$chunkFile = $this->path . "{$data['hash']}_{$data['total']}_{$i}.chunk";
if (!file_exists($chunkFile)) {
throw new ApiException('切片文件查找失败,请重新上传');
throw new ApiException('Chunk file not found, please upload again');
}
fwrite($fileHandle, file_get_contents($chunkFile));
unlink($chunkFile);