diff --git a/app/admin/controller/File.php b/app/admin/controller/File.php index f4127afddd40b68da65f59909c7c32ec8cd1732b..3c12139d8f219a49ae909b044eae49bf8d9fcc4c 100644 --- a/app/admin/controller/File.php +++ b/app/admin/controller/File.php @@ -19,8 +19,23 @@ class File extends Base{ //上传文件接口,返回路径地址 public function upload() { + $zz_get = $this->request->get(); + $post=$this->request->post(); $file=$this->request->file(); + + + + if (!empty($zz_get['zz_type'])) { + if ($zz_get['zz_type'] == 'uploadimage') { + $post['file_type'] = 'img'; + } else if ($zz_get['zz_type'] == 'uploadvideo') { + $post['file_type'] = 'video'; + } + $post['attachurl'] = true; + } + + if (isset($post['file_type'])) { //是否远程上传,本地是否删除 @@ -104,6 +119,20 @@ class File extends Base{ $attachurl=SunFile::attachurl(); $data['attachurl'] =$attachurl; } + + + + if (!empty($zz_get['zz_from']) && $zz_get['zz_from'] == 'ue') { + return json([ + 'state' => 'SUCCESS', + 'url' => $data['attachurl'] . $data['path'] ?? '', + 'original' => '', + 'size' => '', + 'title' => '', + 'type' => '', + ]); + } + return jsonResult(200, "上传成功", $data); @@ -112,4 +141,4 @@ class File extends Base{ } -} \ No newline at end of file +}