更新图片上传
This commit is contained in:
parent
f4daf29d0c
commit
95ef57c67a
46
app/middleapi/controller/UploadController.php
Normal file
46
app/middleapi/controller/UploadController.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\middleapi\controller;
|
||||||
|
|
||||||
|
use app\common\service\UploadService;
|
||||||
|
use Exception;
|
||||||
|
use app\common\controller\BaseLikeAdminController;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典数据
|
||||||
|
* Class DictDataController
|
||||||
|
* @package app\adminapi\controller\dictionary
|
||||||
|
*/
|
||||||
|
class UploadController extends BaseLikeAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
public function image()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$cid = $this->request->post('cid', 0);
|
||||||
|
$result = UploadService::image($cid);
|
||||||
|
return $this->success('上传成功', $result);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return $this->fail($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 上传文件
|
||||||
|
* @return Json
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2021/12/29 16:27
|
||||||
|
*/
|
||||||
|
public function file()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$cid = $this->request->post('cid', 0);
|
||||||
|
$result = UploadService::file($cid);
|
||||||
|
return $this->success('上传成功', $result);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return $this->fail($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user