소스 검색

增加生活补贴捕获头像图片错误

sugangqiang 1 년 전
부모
커밋
cb7d50e4cf
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      app/enterprise/controller/LivingAllowance.php

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

@@ -267,6 +267,9 @@ class LivingAllowance extends EnterpriseController {
                 $headimg = $request->file("file");
                 $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);