Browse Source

复用上传图片接口

wufeng 2 years ago
parent
commit
ec78eaaaa0
2 changed files with 13 additions and 0 deletions
  1. 12 0
      app/abutment/controller/Index.php
  2. 1 0
      app/abutment/route/app.php

+ 12 - 0
app/abutment/controller/Index.php

@@ -242,5 +242,17 @@ class Index extends BaseController
         return json_show(0, "获取成功", $vmp);
     }
 
+    //上传图片
+    public function uploadImg()
+    {
+        $files = $this->request->file('image');
+        $list = "";
+        if ($files != "") $list = UploadImg($files);
+
+        if (is_array($list) && !empty($list)) return json_show(0, "上传成功!", $list);
+        else return json_show(1005, "上传失败!" . $list);
+
+    }
+
 
 }

+ 1 - 0
app/abutment/route/app.php

@@ -19,6 +19,7 @@ route::rule('getAreaList', 'abutment/Index/getAreaList');//获取省市区列表
 route::rule('getCompanyNoList', 'abutment/Index/getCompanyNoList');//获取业务公司编码
 route::rule('businessList', 'abutment/Index/businessList');//获取业务公司编码-前端
 route::rule('getExclusiveList', 'abutment/Index/getExclusiveList');//专属类型列表
+route::rule('uploadImg', 'abutment/Index/uploadImg');//上传图片
 
 
 //商品模块