更新图片上传

This commit is contained in:
yaooo 2023-11-16 16:33:43 +08:00
parent eb79169226
commit 38fc6e4850
1 changed files with 6 additions and 0 deletions

View File

@ -47,6 +47,9 @@ class UploadController extends BaseAdminController
public function taskImage(): Json
{
$params=$this->request->post();
if (empty($_FILES['file'])) {
return $this->fail('请上传图片');
}
$result = curl_post_file(env('project.worker_domain').'/middleapi/upload/image', $_FILES['file']['tmp_name'], $_FILES['file']['name'], $_FILES['file']['type'],$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
@ -58,6 +61,9 @@ class UploadController extends BaseAdminController
public function taskFile(): Json
{
$params=$this->request->post();
if (empty($_FILES['file'])) {
return $this->fail('请上传图片');
}
$result = curl_post_file(env('project.worker_domain').'/middleapi/upload/file', $_FILES['file']['tmp_name'], $_FILES['file']['name'], $_FILES['file']['type'],$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);