feat:修复自定义上传文件接口找不到问题

main
gzydong 2021-10-09 10:54:00 +08:00
parent d8e8a00f1b
commit 6c5c12c633
1 changed files with 3 additions and 1 deletions

View File

@ -132,7 +132,7 @@ class EmoticonController extends CController
/** /**
* 自定义上传表情包 * 自定义上传表情包
* *
* @RequestMapping(path="upload", methods="post") * @RequestMapping(path="upload-emoticon", methods="post")
* @param Filesystem $filesystem * @param Filesystem $filesystem
* @return ResponseInterface * @return ResponseInterface
*/ */
@ -142,6 +142,7 @@ class EmoticonController extends CController
if (!$file->isValid()) { if (!$file->isValid()) {
return $this->response->fail( return $this->response->fail(
'图片上传失败,请稍后再试!', '图片上传失败,请稍后再试!',
[],
ResponseCode::VALIDATION_ERROR ResponseCode::VALIDATION_ERROR
); );
} }
@ -150,6 +151,7 @@ class EmoticonController extends CController
if (!in_array($ext, ['jpg', 'png', 'jpeg', 'gif', 'webp'])) { if (!in_array($ext, ['jpg', 'png', 'jpeg', 'gif', 'webp'])) {
return $this->response->fail( return $this->response->fail(
'图片格式错误目前仅支持jpg、png、jpeg、gif和webp', '图片格式错误目前仅支持jpg、png、jpeg、gif和webp',
[],
ResponseCode::VALIDATION_ERROR ResponseCode::VALIDATION_ERROR
); );
} }