1234567891011121314151617181920 |
- <?php
- namespace app\admin\controller;
- use app\BaseController;use think\App;
- class Upload extends BaseController{
- public function __construct(App $app) {parent::__construct($app);}
- //图片上传接口;
- public function UploadImg(){
- $img =$this->request->file('img');
- if(!isset($img)||empty($img) ||$img==''){
- return error_show(1004,"参数 img 不能为空");
- }
- $data =UploadImg($img);
- if(is_array($data)) return app_show(0,"上传成功",$data); else return error_show(1004,"上传失败");
- }
- }
|