WokerTask/app/middleapi/controller/UploadController.php

46 lines
1.0 KiB
PHP
Raw Permalink Normal View History

2023-12-27 14:06:33 +08:00
<?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());
}
}
}