fileInfo->getinfo(); $thumbPath = Upload::thumb($res->dir); SystemAttachmentModel::attachmentAdd($res->fileInfo->getSaveName(), $fileInfo['size'], $fileInfo['type'], $res->dir, $thumbPath, 0); $info = array( "originalName" => $fileInfo['name'], "name" => $res->fileInfo->getSaveName(), "url" => '.' . $res->dir, "size" => $fileInfo['size'], "type" => $fileInfo['type'], "state" => "SUCCESS" ); echo json_encode($info); } public function index($action) { $CONFIG = json_decode(preg_replace("/\/\*[\s\S]+?\*\//", "", file_get_contents("system/plug/ueditor/php/config.json")), true); $CONFIG['imageUrlPrefix'] = SystemConfigService::get('uploadUrl'); switch ($action) { case 'config': $result = json_encode($CONFIG); break; /* 上传图片 */ case 'uploadimage': /* 上传涂鸦 */ case 'uploadscrawl': /* 上传视频 */ case 'uploadvideo': /* 上传文件 */ case 'uploadfile': $result = json_encode([]); break; /* 列出图片 */ case 'listimage': $result = json_encode([]); break; default: $result = json_encode(array( 'state' => '请求地址出错' )); break; } return $result; } }