Bläddra i källkod

修改头像太大的提示

sandm 2 år sedan
förälder
incheckning
f9689fbeea
1 ändrade filer med 3 tillägg och 0 borttagningar
  1. 3 0
      app/enterprise/controller/Talent.php

+ 3 - 0
app/enterprise/controller/Talent.php

@@ -634,6 +634,9 @@ class Talent extends EnterpriseController {
                 $headimg = $request->file("photo");
                 $upload = new \app\common\api\UploadApi();
                 $result = $upload->uploadOne($headimg, "image", "talent/photo");
+                if($result->code != 200){
+                    throw new ValidateException($result->msg);
+                }
                 $file = imagecreatefromstring(file_get_contents("storage/" . $result->filepath));
                 $width = imagesx($file);
                 $height = imagesy($file);