xielin 5 년 전
부모
커밋
0d4ae97cfc
1개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 4
      app/Http/Controllers/UploadController.php

+ 3 - 4
app/Http/Controllers/UploadController.php

@@ -27,7 +27,7 @@ class UploadController extends Controller
                 $width = Image::make($filePath)->width();
                 $height = Image::make($filePath)->height();
                 //要保存的文件名 时间+扩展名
-                $filename = time() . '_' . uniqid() . '*' . $width . '_' . $height . '.' . $kuoname;
+                $filename = time() . '_' . uniqid() . '.' . $kuoname . '?' . $width . '_' . $height;
             } else {
                 //要保存的文件名 时间+扩展名
                 $filename = time() . '_' . uniqid() . '.' . $kuoname;
@@ -58,9 +58,8 @@ class UploadController extends Controller
                 $width = Image::make($filePath)->width();
                 $height = Image::make($filePath)->height();
                 //要保存的文件名 时间+扩展名
-                $filename = time() . '_' . uniqid() . '*' . $width . '_' . $height . '.' . $kuoname;
-                //todo 等待客户端更新后替换为下列规则
-                //$filename = time() . '_' . uniqid() . '.' . $kuoname . '?' . $width . '_' . $height;
+                //$filename = time() . '_' . uniqid() . '*' . $width . '_' . $height . '.' . $kuoname;
+                $filename = time() . '_' . uniqid() . '.' . $kuoname . '?' . $width . '_' . $height;
             } else {
                 //要保存的文件名 时间+扩展名
                 $filename = time() . '_' . uniqid() . '.' . $kuoname;