修改原有框架中英文映射
This commit is contained in:
@@ -38,7 +38,7 @@ class SystemAttachmentLogic extends BaseLogic
|
||||
{
|
||||
$category = SystemCategory::where('id', $category_id)->findOrEmpty();
|
||||
if ($category->isEmpty()) {
|
||||
throw new ApiException('目标分类不存在');
|
||||
throw new ApiException('Target category not found');
|
||||
}
|
||||
return $this->model->whereIn('id', $ids)->update(['category_id' => $category_id]);
|
||||
}
|
||||
@@ -54,11 +54,11 @@ class SystemAttachmentLogic extends BaseLogic
|
||||
{
|
||||
$image_data = file_get_contents($url);
|
||||
if ($image_data === false) {
|
||||
throw new ApiException('获取文件资源失败');
|
||||
throw new ApiException('Failed to get file resource');
|
||||
}
|
||||
$image_resource = imagecreatefromstring($image_data);
|
||||
if (!$image_resource) {
|
||||
throw new ApiException('创建图片资源失败');
|
||||
throw new ApiException('Failed to create image resource');
|
||||
}
|
||||
$filename = basename($url);
|
||||
$file_extension = pathinfo($filename, PATHINFO_EXTENSION);
|
||||
@@ -84,11 +84,11 @@ class SystemAttachmentLogic extends BaseLogic
|
||||
break;
|
||||
default:
|
||||
imagedestroy($image_resource);
|
||||
throw new ApiException('文件格式错误');
|
||||
throw new ApiException('Invalid file format');
|
||||
}
|
||||
imagedestroy($image_resource);
|
||||
if (!$result) {
|
||||
throw new ApiException('文件保存失败');
|
||||
throw new ApiException('Failed to save file');
|
||||
}
|
||||
|
||||
$hash = md5_file($save_path);
|
||||
|
||||
Reference in New Issue
Block a user