具体操作步骤我是看下面的:https://jingyan.baidu.com/article/2a138328d86a57074b134f76.html
第一步源码下载(建议composer下载):PHP SDK 源码地址
第二步:在controller下建一个Image.php文件 代码如下
<?php
namespace app\admin\controller;
use think\Controller;
use think\Request;
use app\common\lib\Upload;
class Image extends Base
{
/*
图片上传
*/
public function upload0(){
$file = Request::instance()->file('file');
//把图片上传指定的的文件夹中
$info = $file->move('upload');
if($info && $info->getPathname()) {
$data = [
'status' => 1,
'message' => 'Ok',
'data' => '/'.$info->getPathname(),
];
echo json_encode($data)