|
|
@@ -380,6 +380,8 @@ class ImageGenerationController extends BaseController
|
|
|
* @return void
|
|
|
*/
|
|
|
public function batchUploadImg(Request $request) {
|
|
|
+ $sourceType = (int)$request->input('source_type', 0);
|
|
|
+
|
|
|
$refImgUrls = [];
|
|
|
$refVideoUrls = [];
|
|
|
$refAudioUrls = [];
|
|
|
@@ -404,8 +406,10 @@ class ImageGenerationController extends BaseController
|
|
|
'size' => $refImgFile->getSize(),
|
|
|
];
|
|
|
|
|
|
- // 验证图片规格
|
|
|
- $this->validateImageSpecs($refImg, $index + 1);
|
|
|
+ // 验证图片规格(头像来源跳过)
|
|
|
+ if ($sourceType !== 1) {
|
|
|
+ $this->validateImageSpecs($refImg, $index + 1);
|
|
|
+ }
|
|
|
|
|
|
// 上传图片到服务器并获取URL
|
|
|
$filename = randStr(10) . '.' . $refImgFile->getClientOriginalExtension();
|
|
|
@@ -454,8 +458,10 @@ class ImageGenerationController extends BaseController
|
|
|
'size' => strlen($refImgBinary),
|
|
|
];
|
|
|
|
|
|
- // 验证图片规格
|
|
|
- $this->validateImageSpecs($refImg, $index + 1);
|
|
|
+ // 验证图片规格(头像来源跳过)
|
|
|
+ if ($sourceType !== 1) {
|
|
|
+ $this->validateImageSpecs($refImg, $index + 1);
|
|
|
+ }
|
|
|
|
|
|
// 上传图片到服务器并获取URL(默认使用.jpg格式)
|
|
|
$filename = randStr(10) . '.jpg';
|