|
...
|
...
|
@@ -165,7 +165,8 @@ class ImageController extends Controller |
|
|
|
if ($rs === false) {
|
|
|
|
return $this->response('添加失败', Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
return $this->uploadCos($this->path,$fileName,$data['type']);
|
|
|
|
$cos = new TencentCosService();
|
|
|
|
return $cos->uploadToCos($files,$this->path,$fileName);
|
|
|
|
return $this->response('图片资源',Code::SUCCESS,['image'=>$hash]);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -320,15 +321,4 @@ class ImageController extends Controller |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :上传文件到cos
|
|
|
|
* @name :uploadCos
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/18 17:38
|
|
|
|
*/
|
|
|
|
public function uploadCos($path,$fileName,$image_type){
|
|
|
|
$txCos = new TencentCosService();
|
|
|
|
return $txCos->upload_image($path,$fileName,$image_type);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|